shithub: riscv

Download patch

ref: 71a3ab3f13602a1fbac057c2413032fce9f56d9c
parent: 6025ad06da148fa368f927c382281a3402a2dc0f
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sun May 26 23:26:53 EDT 2013

kernel: make imagereclaim() skip notext pages (prevent it from blowing the mount cache)

imagereclaim would happily uncache pages from the mountcache (port/cache.c)
without ever getting a Image* released from it. simple fix, just check for
p->image->notext but make sure todo it under the page lock :)

--- a/sys/src/9/port/segment.c
+++ b/sys/src/9/port/segment.c
@@ -333,7 +333,7 @@
 	 */
 	for(p = palloc.tail; p && p->image && (n<1000 || !imagealloc.free); p = p->prev) {
 		if(p->ref == 0 && canlock(p)) {
-			if(p->ref == 0) {
+			if(p->ref == 0 && p->image && !p->image->notext) {
 				n++;
 				uncachepage(p);
 			}
--