make pc kernels graphics image memory pool unlimited by default, add *imagemaxmb= kernel parameter

This commit is contained in:
cinap_lenrek 2012-03-18 20:12:29 +01:00
parent 129408103c
commit 8745e29e15
2 changed files with 15 additions and 8 deletions

View file

@ -667,6 +667,10 @@ Terminals use more kernel memory because
.IR draw (3) .IR draw (3)
maintains its graphic images in kernel memory. maintains its graphic images in kernel memory.
This deprecated option is rarely necessary in newer kernels. This deprecated option is rarely necessary in newer kernels.
.SS \fL*imagemaxmb=\fIvalue\fP
This limits the maximum amount of memory (in megabytes) the graphics
image memory pool can grow. The default is unlimited for terminals
and cpu servers.
.SS \fL*nomce=\fIvalue\fP .SS \fL*nomce=\fIvalue\fP
If machine check exceptions are supported by the processor, If machine check exceptions are supported by the processor,
then they are enabled by default. then they are enabled by default.

View file

@ -415,7 +415,7 @@ confinit(void)
* 4MB on the first Image chunk allocation. * 4MB on the first Image chunk allocation.
*/ */
if(conf.npage*BY2PG < 16*MB) if(conf.npage*BY2PG < 16*MB)
imagmem->minarena = 4*1024*1024; imagmem->minarena = 4*MB;
} }
/* /*
@ -440,13 +440,16 @@ confinit(void)
+ conf.nswap + conf.nswap
+ conf.nswppo*sizeof(Page*); + conf.nswppo*sizeof(Page*);
mainmem->maxsize = kpages; mainmem->maxsize = kpages;
if(!cpuserver){
/* /*
* give terminals lots of image memory, too; the dynamic * the dynamic allocation will balance the load properly,
* allocation will balance the load properly, hopefully. * hopefully. be careful with 32-bit overflow.
* be careful with 32-bit overflow.
*/ */
imagmem->maxsize = kpages; imagmem->maxsize = mainmem->maxsize;
if(p = getconf("*imagemaxmb")){
imagmem->maxsize = strtol(p, nil, 0)*MB;
if(imagmem->maxsize > mainmem->maxsize)
imagmem->maxsize = mainmem->maxsize;
} }
} }