Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm Deactivate pages in batch instead of acquiring uvm_p...



details:   https://anonhg.NetBSD.org/src/rev/8b9977a2d758
branches:  trunk
changeset: 846777:8b9977a2d758
user:      ad <ad%NetBSD.org@localhost>
date:      Sun Dec 01 14:30:01 2019 +0000

description:
Deactivate pages in batch instead of acquiring uvm_pageqlock repeatedly.

diffstat:

 sys/uvm/uvm_fault.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 9103569a030f -r 8b9977a2d758 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c       Sun Dec 01 14:28:01 2019 +0000
+++ b/sys/uvm/uvm_fault.c       Sun Dec 01 14:30:01 2019 +0000
@@ -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 @@
        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);
 }
 
 /*



Home | Main Index | Thread Index | Old Index