diff options
| -rw-r--r-- | sys/vm/vm_fault.c | 3 | ||||
| -rw-r--r-- | sys/vm/vm_page.c | 2 | ||||
| -rw-r--r-- | sys/vm/vm_pageout.c | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index c341661b02de..aa1d0223593d 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -444,6 +444,7 @@ readrest: else firstpindex = fs.first_pindex - 2 * VM_FAULT_READ; + vm_page_lock_queues(); /* * note: partially valid pages cannot be * included in the lookahead - NFS piecemeal @@ -471,7 +472,7 @@ readrest: vm_page_cache(mt); } } - + vm_page_unlock_queues(); ahead += behind; behind = 0; } diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 7a03d4749c8d..831f8c876557 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1412,7 +1412,7 @@ vm_page_cache(vm_page_t m) { int s; - GIANT_REQUIRED; + mtx_assert(&vm_page_queue_mtx, MA_OWNED); if ((m->flags & (PG_BUSY|PG_UNMANAGED)) || m->busy || m->wire_count) { printf("vm_page_cache: attempting to cache busy page\n"); return; diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 7dce8e890ae8..047fac1ca1c8 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -792,7 +792,9 @@ rescan0: * effectively frees them. */ } else if (m->dirty == 0) { + vm_page_lock_queues(); vm_page_cache(m); + vm_page_unlock_queues(); --page_shortage; } else if ((m->flags & PG_WINATCFLS) == 0 && pass == 0) { /* |
