Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm uvm_pdpolicy: Require a write lock on the object onl...



details:   https://anonhg.NetBSD.org/src/rev/fdd5318b462f
branches:  trunk
changeset: 1008191:fdd5318b462f
user:      ad <ad%NetBSD.org@localhost>
date:      Sat Mar 14 13:53:26 2020 +0000

description:
uvm_pdpolicy: Require a write lock on the object only for dequeue.
No sense in requiring that for enqueue/activate/deactivate.

diffstat:

 sys/uvm/uvm_pdpolicy_clock.c    |  10 +++++-----
 sys/uvm/uvm_pdpolicy_clockpro.c |   6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r 7a73c3294b36 -r fdd5318b462f sys/uvm/uvm_pdpolicy_clock.c
--- a/sys/uvm/uvm_pdpolicy_clock.c      Sat Mar 14 13:50:46 2020 +0000
+++ b/sys/uvm/uvm_pdpolicy_clock.c      Sat Mar 14 13:53:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pdpolicy_clock.c,v 1.34 2020/03/08 15:01:50 ad Exp $       */
+/*     $NetBSD: uvm_pdpolicy_clock.c,v 1.35 2020/03/14 13:53:26 ad Exp $       */
 /*     NetBSD: uvm_pdaemon.c,v 1.72 2006/01/05 10:47:33 yamt Exp $     */
 
 /*-
@@ -98,7 +98,7 @@
 #else /* defined(PDSIM) */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.34 2020/03/08 15:01:50 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.35 2020/03/14 13:53:26 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -463,7 +463,7 @@
 uvmpdpol_pagedeactivate(struct vm_page *pg)
 {
 
-       KASSERT(uvm_page_owner_locked_p(pg, true));
+       KASSERT(uvm_page_owner_locked_p(pg, false));
        KASSERT(mutex_owned(&pg->interlock));
 
        /*
@@ -495,7 +495,7 @@
 uvmpdpol_pageactivate(struct vm_page *pg)
 {
 
-       KASSERT(uvm_page_owner_locked_p(pg, true));
+       KASSERT(uvm_page_owner_locked_p(pg, false));
        KASSERT(mutex_owned(&pg->interlock));
 
        uvmpdpol_set_intent(pg, PQ_INTENT_A);
@@ -536,7 +536,7 @@
 uvmpdpol_pageenqueue(struct vm_page *pg)
 {
 
-       KASSERT(uvm_page_owner_locked_p(pg, true));
+       KASSERT(uvm_page_owner_locked_p(pg, false));
        KASSERT(mutex_owned(&pg->interlock));
 
        uvmpdpol_set_intent(pg, PQ_INTENT_E);
diff -r 7a73c3294b36 -r fdd5318b462f sys/uvm/uvm_pdpolicy_clockpro.c
--- a/sys/uvm/uvm_pdpolicy_clockpro.c   Sat Mar 14 13:50:46 2020 +0000
+++ b/sys/uvm/uvm_pdpolicy_clockpro.c   Sat Mar 14 13:53:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pdpolicy_clockpro.c,v 1.23 2020/01/30 12:28:51 ad Exp $    */
+/*     $NetBSD: uvm_pdpolicy_clockpro.c,v 1.24 2020/03/14 13:53:26 ad Exp $    */
 
 /*-
  * Copyright (c)2005, 2006 YAMAMOTO Takashi,
@@ -43,7 +43,7 @@
 #else /* defined(PDSIM) */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clockpro.c,v 1.23 2020/01/30 12:28:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clockpro.c,v 1.24 2020/03/14 13:53:26 ad Exp $");
 
 #include "opt_ddb.h"
 
@@ -645,7 +645,7 @@
        bool referenced;
 
        KASSERT(mutex_owned(&clockpro.lock));
-       KASSERT(!locked || uvm_page_owner_locked_p(pg));
+       KASSERT(!locked || uvm_page_owner_locked_p(pg, false));
        if (!locked) {
                /*
                 * acquire interlock to stablize page identity.



Home | Main Index | Thread Index | Old Index