Module Name: src Committed By: ad Date: Sun Dec 1 14:30:01 UTC 2019
Modified Files: src/sys/uvm: uvm_fault.c Log Message: Deactivate pages in batch instead of acquiring uvm_pageqlock repeatedly. To generate a diff of this commit: cvs rdiff -u -r1.210 -r1.211 src/sys/uvm/uvm_fault.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/uvm/uvm_fault.c diff -u src/sys/uvm/uvm_fault.c:1.210 src/sys/uvm/uvm_fault.c:1.211 --- src/sys/uvm/uvm_fault.c:1.210 Sun Dec 1 10:19:59 2019 +++ src/sys/uvm/uvm_fault.c Sun Dec 1 14:30:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_fault.c,v 1.210 2019/12/01 10:19:59 martin Exp $ */ +/* $NetBSD: uvm_fault.c,v 1.211 2019/12/01 14:30:01 ad Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.210 2019/12/01 10:19:59 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.211 2019/12/01 14:30:01 ad Exp $"); #include "opt_uvmhist.h" @@ -191,19 +191,19 @@ uvmfault_anonflush(struct vm_anon **anon int lcv; struct vm_page *pg; + mutex_enter(&uvm_pageqlock); for (lcv = 0; lcv < n; lcv++) { if (anons[lcv] == NULL) continue; KASSERT(mutex_owned(anons[lcv]->an_lock)); pg = anons[lcv]->an_page; if (pg && (pg->flags & PG_BUSY) == 0) { - mutex_enter(&uvm_pageqlock); if (pg->wire_count == 0) { uvm_pagedeactivate(pg); } - mutex_exit(&uvm_pageqlock); } } + mutex_exit(&uvm_pageqlock); } /*