Module Name:    src
Committed By:   ad
Date:           Sat Dec 14 21:36:00 UTC 2019

Modified Files:
        src/sys/uvm: uvm_pager.c uvm_pdaemon.c

Log Message:
The uvmexp.pdpending change was incorrect - revert for now.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/uvm/uvm_pager.c
cvs rdiff -u -r1.114 -r1.115 src/sys/uvm/uvm_pdaemon.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_pager.c
diff -u src/sys/uvm/uvm_pager.c:1.115 src/sys/uvm/uvm_pager.c:1.116
--- src/sys/uvm/uvm_pager.c:1.115	Sat Dec 14 15:04:47 2019
+++ src/sys/uvm/uvm_pager.c	Sat Dec 14 21:36:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pager.c,v 1.115 2019/12/14 15:04:47 ad Exp $	*/
+/*	$NetBSD: uvm_pager.c,v 1.116 2019/12/14 21:36:00 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pager.c,v 1.115 2019/12/14 15:04:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pager.c,v 1.116 2019/12/14 21:36:00 ad Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_readahead.h"
@@ -473,6 +473,7 @@ uvm_aio_aiodone_pages(struct vm_page **p
 			else
 				uvm_swap_free(swslot, npages);
 		}
+		atomic_dec_uint(&uvmexp.pdpending);
 #endif /* defined(VMSWAP) */
 	}
 }

Index: src/sys/uvm/uvm_pdaemon.c
diff -u src/sys/uvm/uvm_pdaemon.c:1.114 src/sys/uvm/uvm_pdaemon.c:1.115
--- src/sys/uvm/uvm_pdaemon.c:1.114	Sat Dec 14 15:04:47 2019
+++ src/sys/uvm/uvm_pdaemon.c	Sat Dec 14 21:36:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pdaemon.c,v 1.114 2019/12/14 15:04:47 ad Exp $	*/
+/*	$NetBSD: uvm_pdaemon.c,v 1.115 2019/12/14 21:36:00 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.114 2019/12/14 15:04:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.115 2019/12/14 21:36:00 ad Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_readahead.h"
@@ -368,7 +368,6 @@ void
 uvm_pageout_start(int npages)
 {
 
-	atomic_inc_uint(&uvmexp.pdpending);
 	atomic_add_int(&uvmexp.paging, npages);
 }
 
@@ -377,7 +376,6 @@ uvm_pageout_done(int npages)
 {
 
 	KASSERT(uvmexp.paging >= npages);
-	atomic_dec_uint(&uvmexp.pdpending);
 	atomic_add_int(&uvmexp.paging, -npages);
 
 	/*
@@ -901,12 +899,14 @@ uvmpd_scan_queue(void)
 		}
 		mutex_exit(slock);
 
+		swapcluster_flush(&swc, false);
+
 		/*
-		 * set the pageout in progress.  bump counters and set up
+		 * the pageout is in progress.  bump counters and set up
 		 * for the next loop.
 		 */
 
-		swapcluster_flush(&swc, false);
+		atomic_inc_uint(&uvmexp.pdpending);
 
 #else /* defined(VMSWAP) */
 		uvm_pageactivate(p);

Reply via email to