git: 9front

Download patch

ref: 4d6045fd441869dcf6742ec9a2551692c414786d
parent: 68f55577ce3a14c3f7a94db25fbd291ff44d8213
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Fri Aug 2 13:52:51 EDT 2013

do not limit kernelpercent IFF *imagemaxmb= is used on a cpu server

the heuristics that limits kernel memory on a cpu server to
a fixed amout (64MB + size for page tables) makes using devdraw
impractical.

if *imagemaxmb= is specified, we can assume that the draw device
will be used so we want to get a reasonable amount (30% default)
of kernel memory.

--- a/sys/src/9/pc/main.c
+++ b/sys/src/9/pc/main.c
@@ -412,6 +412,7 @@
 		 * The patch of nimage is a band-aid, scanning the whole
 		 * page list in imagereclaim just takes too long.
 		 */
+		if(getconf("*imagemaxmb") == 0)
 		if(kpages > (64*MB + conf.npage*sizeof(Page))/BY2PG){
 			kpages = (64*MB + conf.npage*sizeof(Page))/BY2PG;
 			conf.nimage = 2000;
--