mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 00:02:44 +00:00
Decrease the latency/overhead in the prezero code when there is
an adequate number of prezeroed pages.
This commit is contained in:
parent
c16cb2c78b
commit
8e56e56134
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24099
@ -38,7 +38,7 @@
|
||||
*
|
||||
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
|
||||
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
|
||||
* $Id$
|
||||
* $Id: vm_machdep.c,v 1.75 1997/02/22 09:33:01 peter Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -854,7 +854,22 @@ int
|
||||
vm_page_zero_idle() {
|
||||
vm_page_t m;
|
||||
static int free_rover = 0;
|
||||
if ((cnt.v_free_count > cnt.v_interrupt_free_min) &&
|
||||
/* XXX
|
||||
* We stop zeroing pages when there are sufficent prezeroed pages.
|
||||
* This threshold isn't really needed, except we want to
|
||||
* bypass unneeded calls to vm_page_list_find, and the
|
||||
* associated cache flush and latency. The pre-zero will
|
||||
* still be called when there are significantly more
|
||||
* non-prezeroed pages than zeroed pages. The threshold
|
||||
* of half the number of reserved pages is arbitrary, but
|
||||
* approximately the right amount. Eventually, we should
|
||||
* perhaps interrupt the zero operation when a process
|
||||
* is found to be ready to run.
|
||||
*/
|
||||
if (((cnt.v_free_count - vm_page_zero_count) > (cnt.v_free_reserved / 2)) &&
|
||||
#ifdef NOT_NEEDED
|
||||
(cnt.v_free_count > cnt.v_interrupt_free_min) &&
|
||||
#endif
|
||||
(m = vm_page_list_find(PQ_FREE, free_rover))) {
|
||||
--(*vm_page_queues[m->queue].lcnt);
|
||||
TAILQ_REMOVE(vm_page_queues[m->queue].pl, m, pageq);
|
||||
|
@ -38,7 +38,7 @@
|
||||
*
|
||||
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
|
||||
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
|
||||
* $Id$
|
||||
* $Id: vm_machdep.c,v 1.75 1997/02/22 09:33:01 peter Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
@ -854,7 +854,22 @@ int
|
||||
vm_page_zero_idle() {
|
||||
vm_page_t m;
|
||||
static int free_rover = 0;
|
||||
if ((cnt.v_free_count > cnt.v_interrupt_free_min) &&
|
||||
/* XXX
|
||||
* We stop zeroing pages when there are sufficent prezeroed pages.
|
||||
* This threshold isn't really needed, except we want to
|
||||
* bypass unneeded calls to vm_page_list_find, and the
|
||||
* associated cache flush and latency. The pre-zero will
|
||||
* still be called when there are significantly more
|
||||
* non-prezeroed pages than zeroed pages. The threshold
|
||||
* of half the number of reserved pages is arbitrary, but
|
||||
* approximately the right amount. Eventually, we should
|
||||
* perhaps interrupt the zero operation when a process
|
||||
* is found to be ready to run.
|
||||
*/
|
||||
if (((cnt.v_free_count - vm_page_zero_count) > (cnt.v_free_reserved / 2)) &&
|
||||
#ifdef NOT_NEEDED
|
||||
(cnt.v_free_count > cnt.v_interrupt_free_min) &&
|
||||
#endif
|
||||
(m = vm_page_list_find(PQ_FREE, free_rover))) {
|
||||
--(*vm_page_queues[m->queue].lcnt);
|
||||
TAILQ_REMOVE(vm_page_queues[m->queue].pl, m, pageq);
|
||||
|
Loading…
Reference in New Issue
Block a user