Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156786763
D42513.id129873.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1009 B
Referenced Files
None
Subscribers
None
D42513.id129873.diff
View Options
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -4436,7 +4436,8 @@
VM_OBJECT_ASSERT_WLOCKED(m->object);
vm_page_assert_xbusied(m);
- if (advice == MADV_FREE)
+ switch (advice) {
+ case MADV_FREE:
/*
* Mark the page clean. This will allow the page to be freed
* without first paging it out. MADV_FREE pages are often
@@ -4444,15 +4445,19 @@
* would result in a page fault on a later access.
*/
vm_page_undirty(m);
- else if (advice != MADV_DONTNEED) {
- if (advice == MADV_WILLNEED)
- vm_page_activate(m);
+ break;
+ case MADV_DONTNEED:
+ if (m->dirty == 0 && pmap_is_modified(m))
+ vm_page_dirty(m);
+ break;
+ case MADV_WILLNEED:
+ vm_page_activate(m);
+ return;
+ default:
+ /* Do nothing. */
return;
}
- if (advice != MADV_FREE && m->dirty == 0 && pmap_is_modified(m))
- vm_page_dirty(m);
-
/*
* Clear any references to the page. Otherwise, the page daemon will
* immediately reactivate the page.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 17, 9:16 AM (18 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33185948
Default Alt Text
D42513.id129873.diff (1009 B)
Attached To
Mode
D42513: vm_page_advise(): reformat conditional statements
Attached
Detach File
Event Timeline
Log In to Comment