summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_zeroidle.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2007-05-18 07:10:50 +0000
committerjeff <jeff@FreeBSD.org>2007-05-18 07:10:50 +0000
commite1996cb9609d2e55a26ee78dddbfce4ba4073b53 (patch)
treec94b660d4b9246fed8cbeadf7851932258d8b72a /sys/vm/vm_zeroidle.c
parentbeb495eff1db0646624feb7071ced7f632ff8869 (diff)
downloadFreeBSD-src-e1996cb9609d2e55a26ee78dddbfce4ba4073b53.zip
FreeBSD-src-e1996cb9609d2e55a26ee78dddbfce4ba4073b53.tar.gz
- define and use VMCNT_{GET,SET,ADD,SUB,PTR} macros for manipulating
vmcnts. This can be used to abstract away pcpu details but also changes to use atomics for all counters now. This means sched lock is no longer responsible for protecting counts in the switch routines. Contributed by: Attilio Rao <attilio@FreeBSD.org>
Diffstat (limited to 'sys/vm/vm_zeroidle.c')
-rw-r--r--sys/vm/vm_zeroidle.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/vm/vm_zeroidle.c b/sys/vm/vm_zeroidle.c
index 5af84e0..29144ed 100644
--- a/sys/vm/vm_zeroidle.c
+++ b/sys/vm/vm_zeroidle.c
@@ -90,9 +90,10 @@ vm_page_zero_check(void)
* fast sleeps. We also do not want to be continuously zeroing
* pages because doing so may flush our L1 and L2 caches too much.
*/
- if (zero_state && vm_page_zero_count >= ZIDLE_LO(cnt.v_free_count))
+ if (zero_state && vm_page_zero_count >=
+ ZIDLE_LO(VMCNT_GET(free_count)))
return (0);
- if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
+ if (vm_page_zero_count >= ZIDLE_HI(VMCNT_GET(free_count)))
return (0);
return (1);
}
@@ -115,7 +116,7 @@ vm_page_zero_idle(void)
vm_pageq_enqueue(PQ_FREE + m->pc, m);
++vm_page_zero_count;
++cnt_prezero;
- if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
+ if (vm_page_zero_count >= ZIDLE_HI(VMCNT_GET(free_count)))
zero_state = 1;
}
free_rover = (free_rover + PQ_PRIME2) & PQ_COLORMASK;
OpenPOWER on IntegriCloud