Module Name: src
Committed By: ad
Date: Sat Dec 14 15:04:48 UTC 2019
Modified Files:
src/sys/uvm: uvm_pager.c uvm_pdaemon.c
Log Message:
Adjust pdpending in uvm_pageout_start() and uvm_pageout_done() to avoid
the value going temporarily negative.
To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/uvm/uvm_pager.c
cvs rdiff -u -r1.113 -r1.114 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.114 src/sys/uvm/uvm_pager.c:1.115
--- src/sys/uvm/uvm_pager.c:1.114 Fri Dec 13 20:10:22 2019
+++ src/sys/uvm/uvm_pager.c Sat Dec 14 15:04:47 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_pager.c,v 1.114 2019/12/13 20:10:22 ad Exp $ */
+/* $NetBSD: uvm_pager.c,v 1.115 2019/12/14 15:04:47 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.114 2019/12/13 20:10:22 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pager.c,v 1.115 2019/12/14 15:04:47 ad Exp $");
#include "opt_uvmhist.h"
#include "opt_readahead.h"
@@ -473,7 +473,6 @@ 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.113 src/sys/uvm/uvm_pdaemon.c:1.114
--- src/sys/uvm/uvm_pdaemon.c:1.113 Fri Dec 13 20:10:22 2019
+++ src/sys/uvm/uvm_pdaemon.c Sat Dec 14 15:04:47 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_pdaemon.c,v 1.113 2019/12/13 20:10:22 ad Exp $ */
+/* $NetBSD: uvm_pdaemon.c,v 1.114 2019/12/14 15:04:47 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.113 2019/12/13 20:10:22 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.114 2019/12/14 15:04:47 ad Exp $");
#include "opt_uvmhist.h"
#include "opt_readahead.h"
@@ -368,6 +368,7 @@ void
uvm_pageout_start(int npages)
{
+ atomic_inc_uint(&uvmexp.pdpending);
atomic_add_int(&uvmexp.paging, npages);
}
@@ -376,6 +377,7 @@ uvm_pageout_done(int npages)
{
KASSERT(uvmexp.paging >= npages);
+ atomic_dec_uint(&uvmexp.pdpending);
atomic_add_int(&uvmexp.paging, -npages);
/*
@@ -899,14 +901,12 @@ uvmpd_scan_queue(void)
}
mutex_exit(slock);
- swapcluster_flush(&swc, false);
-
/*
- * the pageout is in progress. bump counters and set up
+ * set the pageout in progress. bump counters and set up
* for the next loop.
*/
- atomic_inc_uint(&uvmexp.pdpending);
+ swapcluster_flush(&swc, false);
#else /* defined(VMSWAP) */
uvm_pageactivate(p);