shithub: riscv

Download patch

ref: 03f68c49f66e2d33acd73a25eac8a1bc0acbf38d
parent: 2fb18c3339cf8255d39bb41d495a79c9fca21ddd
author: cinap_lenrek <[email protected]>
date: Thu Jul 10 23:57:21 EDT 2014

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.

--- a/sys/src/9/port/segment.c
+++ b/sys/src/9/port/segment.c
@@ -250,8 +250,7 @@
 	/* 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");
 		}