From d064e9a2a77db0aeed982270a3dc6d04e482d59c Mon Sep 17 00:00:00 2001 From: alc Date: Sun, 2 Feb 2003 07:16:40 +0000 Subject: [PATCH] - It's more accurate to say that vm_paging_needed() returns TRUE than a positive number. - In pagedaemon_wakeup(), set vm_pages_needed to 1 rather than incrementing it to accomplish the same. --- sys/sys/vmmeter.h | 2 +- sys/vm/vm_pageout.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/sys/vmmeter.h b/sys/sys/vmmeter.h index 64ff1f1b62a7..f9b268067d2c 100644 --- a/sys/sys/vmmeter.h +++ b/sys/sys/vmmeter.h @@ -178,7 +178,7 @@ vm_paging_target(void) } /* - * Return a positive number if the pagedaemon needs to be woken up. + * Returns TRUE if the pagedaemon needs to be woken up. */ static __inline diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 79cc7ed239e4..427d351b6989 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1440,7 +1440,7 @@ vm_pageout() * waste a lot of cpu. */ if (vm_pages_needed && !vm_page_count_min()) { - if (vm_paging_needed() <= 0) + if (!vm_paging_needed()) vm_pages_needed = 0; wakeup(&cnt.v_free_count); } @@ -1484,8 +1484,9 @@ vm_pageout() void pagedaemon_wakeup() { + if (!vm_pages_needed && curthread->td_proc != pageproc) { - vm_pages_needed++; + vm_pages_needed = 1; wakeup(&vm_pages_needed); } }