Page MenuHomeFreeBSD

D24592.diff
No OneTemporary

D24592.diff

Index: head/sys/vm/vm_page.h
===================================================================
--- head/sys/vm/vm_page.h
+++ head/sys/vm/vm_page.h
@@ -958,8 +958,8 @@
*
* Perform a racy check to determine whether a reference prevents the page
* from being reclaimable. If the page's object is locked, and the page is
- * unmapped and unbusied or exclusively busied by the current thread, no
- * new wirings may be created.
+ * unmapped and exclusively busied by the current thread, no new wirings
+ * may be created.
*/
static inline bool
vm_page_wired(vm_page_t m)
Index: head/sys/vm/vm_page.c
===================================================================
--- head/sys/vm/vm_page.c
+++ head/sys/vm/vm_page.c
@@ -4165,7 +4165,16 @@
if ((flags & VPR_TRYFREE) != 0 &&
(m->object->ref_count == 0 || !pmap_page_is_mapped(m)) &&
m->dirty == 0 && vm_page_tryxbusy(m)) {
- vm_page_free(m);
+ /*
+ * An unlocked lookup may have wired the page before the
+ * busy lock was acquired, in which case the page must
+ * not be freed.
+ */
+ if (__predict_true(!vm_page_wired(m))) {
+ vm_page_free(m);
+ return;
+ }
+ vm_page_xunbusy(m);
} else {
vm_page_release_toq(m, PQ_INACTIVE, flags != 0);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Aug 14, 2:25 PM (15 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36734730
Default Alt Text
D24592.diff (1 KB)

Event Timeline