From 03f68c49f66e2d33acd73a25eac8a1bc0acbf38d Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 11 Jul 2014 03:57:21 +0200 Subject: [PATCH] kernel: only complain about no images when theres nothing more to reclaim uncaching a thousand pages (arround 4MB) might not be enougth. so keep on reclaiming pages and only complain once theres nothing more to reclaim. --- sys/src/9/port/segment.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/src/9/port/segment.c b/sys/src/9/port/segment.c index f876e2462..75098a590 100644 --- a/sys/src/9/port/segment.c +++ b/sys/src/9/port/segment.c @@ -250,8 +250,7 @@ attachimage(int type, Chan *c, uintptr base, ulong len) /* dump pages of inactive images to free image structures */ while((i = imagealloc.free) == nil) { unlock(&imagealloc); - imagereclaim(1000); - if(imagealloc.free == nil){ + if(imagereclaim(1000) == 0 && imagealloc.free == nil){ freebroken(); /* can use the memory */ resrcwait("no image after reclaim"); }