summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_pageout.c
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2005-12-31 14:39:20 +0000
committernetchild <netchild@FreeBSD.org>2005-12-31 14:39:20 +0000
commit507a9b3e936156202e89c42d2265863c3903254f (patch)
treec13a8d302e0337dbf08ab02516a66627814ead6b /sys/vm/vm_pageout.c
parentcd697cab850aef4c7941ebff10521fc87dbf7aee (diff)
downloadFreeBSD-src-507a9b3e936156202e89c42d2265863c3903254f.zip
FreeBSD-src-507a9b3e936156202e89c42d2265863c3903254f.tar.gz
MI changes:
- provide an interface (macros) to the page coloring part of the VM system, this allows to try different coloring algorithms without the need to touch every file [1] - make the page queue tuning values readable: sysctl vm.stats.pagequeue - autotuning of the page coloring values based upon the cache size instead of options in the kernel config (disabling of the page coloring as a kernel option is still possible) MD changes: - detection of the cache size: only IA32 and AMD64 (untested) contains cache size detection code, every other arch just comes with a dummy function (this results in the use of default values like it was the case without the autotuning of the page coloring) - print some more info on Intel CPU's (like we do on AMD and Transmeta CPU's) Note to AMD owners (IA32 and AMD64): please run "sysctl vm.stats.pagequeue" and report if the cache* values are zero (= bug in the cache detection code) or not. Based upon work by: Chad David <davidc@acns.ab.ca> [1] Reviewed by: alc, arch (in 2004) Discussed with: alc, Chad David, arch (in 2004)
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r--sys/vm/vm_pageout.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 0a56ca1..9d29de3 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -741,7 +741,7 @@ rescan0:
cnt.v_pdpages++;
- if (m->queue != PQ_INACTIVE) {
+ if (VM_PAGE_GETQUEUE(m) != PQ_INACTIVE) {
goto rescan0;
}
@@ -957,7 +957,7 @@ rescan0:
* reused for another vnode. The object might
* have been reused for another vnode.
*/
- if (m->queue != PQ_INACTIVE ||
+ if (VM_PAGE_GETQUEUE(m) != PQ_INACTIVE ||
m->object != object ||
object->handle != vp) {
if (object->flags & OBJ_MIGHTBEDIRTY)
@@ -1039,7 +1039,7 @@ unlock_and_continue:
while ((m != NULL) && (pcount-- > 0) && (page_shortage > 0)) {
- KASSERT(m->queue == PQ_ACTIVE,
+ KASSERT(VM_PAGE_INQUEUE2(m, PQ_ACTIVE),
("vm_pageout_scan: page %p isn't active", m));
next = TAILQ_NEXT(m, pageq);
@@ -1132,7 +1132,7 @@ unlock_and_continue:
cache_cur = cache_last_free;
cache_first_failure = -1;
while (cnt.v_free_count < cnt.v_free_reserved && (cache_cur =
- (cache_cur + PQ_PRIME2) & PQ_L2_MASK) != cache_first_failure) {
+ (cache_cur + PQ_PRIME2) & PQ_COLORMASK) != cache_first_failure) {
TAILQ_FOREACH(m, &vm_page_queues[PQ_CACHE + cache_cur].pl,
pageq) {
KASSERT(m->dirty == 0,
@@ -1316,7 +1316,7 @@ vm_pageout_page_stats()
while ((m != NULL) && (pcount-- > 0)) {
int actcount;
- KASSERT(m->queue == PQ_ACTIVE,
+ KASSERT(VM_PAGE_INQUEUE2(m, PQ_ACTIVE),
("vm_pageout_page_stats: page %p isn't active", m));
next = TAILQ_NEXT(m, pageq);
@@ -1407,7 +1407,7 @@ vm_pageout()
cnt.v_pageout_free_min = (2*MAXBSIZE)/PAGE_SIZE +
cnt.v_interrupt_free_min;
cnt.v_free_reserved = vm_pageout_page_count +
- cnt.v_pageout_free_min + (cnt.v_page_count / 768) + PQ_L2_SIZE;
+ cnt.v_pageout_free_min + (cnt.v_page_count / 768) + PQ_NUMCOLORS;
cnt.v_free_severe = cnt.v_free_min / 2;
cnt.v_free_min += cnt.v_free_reserved;
cnt.v_free_severe += cnt.v_free_reserved;
OpenPOWER on IntegriCloud