git: 9front

Download patch

ref: bf58057485bca315abe42d7912c1dc1ad7d73155
parent: c6fe3b0e8ac7d0ed478b1d48659f68cead87a215
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Mar 13 10:55:41 EDT 2026

kernel: fix wrong accounting for imagealloc.pgidle (thanks qwx)

The recently added busyimage() call already subtracts
the page count when kicking the image off the idle
list, and putimage() calls idleimage() again whichs
adds the remaining pages back.

We where double subtracting the idle page count which
leads to pgidle count underflow resulting in inaccurate
user page counts reported by /dev/swap.

--- a/sys/src/9/port/segment.c
+++ b/sys/src/9/port/segment.c
@@ -534,7 +534,6 @@
 
 		lock(&imagealloc);
 	}
-	imagealloc.pgidle -= np;
 	unlock(&imagealloc);
 
 	qunlock(&imagealloc.ireclaim);
--