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.
This commit is contained in:
cinap_lenrek 2014-07-11 03:57:21 +02:00
parent 2fb18c3339
commit 03f68c49f6

View file

@ -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");
}