From 521a34d33b85e75013656b3dbb333035ed1d8a41 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 24 Feb 2014 22:42:22 +0100 Subject: kernel: keep cached pages continuous at the end of the page list on imagereclaim() imagereclaim() sabotaged itself by breaking the invariant that cached pages are kept at the end of the page list. once we made a hole of uncached pages, we would stop reclaiming cached pages before it as the loop breaks once it hits a uncached page. (we iterate backwards from the tail to the head of the pagelist until pages have been reclaimed or we hit a uncached page). the solution is to move pages to the head of the pagelist after removing them from the image cache. --- sys/src/9/port/page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/src/9/port/page.c') diff --git a/sys/src/9/port/page.c b/sys/src/9/port/page.c index d76fc4038..60cbee12e 100644 --- a/sys/src/9/port/page.c +++ b/sys/src/9/port/page.c @@ -64,7 +64,7 @@ pageinit(void) print("%ldM swap\n", vkb/1024); } -static void +void pageunchain(Page *p) { if(canlock(&palloc)) -- cgit v1.2.3