From 507a9b3e936156202e89c42d2265863c3903254f Mon Sep 17 00:00:00 2001 From: netchild Date: Sat, 31 Dec 2005 14:39:20 +0000 Subject: 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 [1] Reviewed by: alc, arch (in 2004) Discussed with: alc, Chad David, arch (in 2004) --- sys/vm/vm_contig.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sys/vm/vm_contig.c') diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index 3d57203..c622285 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -141,7 +141,7 @@ vm_contig_launder(int queue) if ((m->flags & PG_MARKER) != 0) continue; - KASSERT(m->queue == queue, + KASSERT(VM_PAGE_INQUEUE2(m, queue), ("vm_contig_launder: page %p's queue is not %d", m, queue)); error = vm_contig_launder_page(m); if (error == 0) @@ -255,7 +255,7 @@ again1: for (i = start; i < (start + size / PAGE_SIZE); i++) { vm_page_t m = &pga[i]; - if ((m->queue - m->pc) == PQ_CACHE) { + if (VM_PAGE_INQUEUE1(m, PQ_CACHE)) { if (m->hold_count != 0) { start++; goto again0; @@ -456,16 +456,15 @@ retry_page: pqtype = m->queue - m->pc; if (pass != 0 && pqtype != PQ_FREE && pqtype != PQ_CACHE) { - switch (m->queue) { - case PQ_ACTIVE: - case PQ_INACTIVE: + if (m->queue == PQ_ACTIVE || + m->queue == PQ_INACTIVE) { if (vm_contig_launder_page(m) != 0) goto cleanup_freed; pqtype = m->queue - m->pc; if (pqtype == PQ_FREE || pqtype == PQ_CACHE) break; - default: + } else { cleanup_freed: vm_page_release_contigl(&pga[i + 1], start + npages - 1 - i); -- cgit v1.1