Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm uvm_pageout_done(): do nothing when npages is zero.



details:   https://anonhg.NetBSD.org/src/rev/7b4d54d5e308
branches:  trunk
changeset: 933490:7b4d54d5e308
user:      ad <ad%NetBSD.org@localhost>
date:      Mon May 25 19:46:20 2020 +0000

description:
uvm_pageout_done(): do nothing when npages is zero.

diffstat:

 sys/uvm/uvm_pdaemon.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r c774102d6a96 -r 7b4d54d5e308 sys/uvm/uvm_pdaemon.c
--- a/sys/uvm/uvm_pdaemon.c     Mon May 25 19:29:08 2020 +0000
+++ b/sys/uvm/uvm_pdaemon.c     Mon May 25 19:46:20 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pdaemon.c,v 1.126 2020/04/13 15:54:45 maxv Exp $   */
+/*     $NetBSD: uvm_pdaemon.c,v 1.127 2020/05/25 19:46:20 ad Exp $     */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.126 2020/04/13 15:54:45 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.127 2020/05/25 19:46:20 ad Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_readahead.h"
@@ -355,7 +355,12 @@
 uvm_pageout_done(int npages)
 {
 
-       KASSERT(uvmexp.paging >= npages);
+       KASSERT(atomic_load_relaxed(&uvmexp.paging) >= npages);
+
+       if (npages == 0) {
+               return;
+       }
+
        atomic_add_int(&uvmexp.paging, -npages);
 
        /*



Home | Main Index | Thread Index | Old Index