shithub: riscv

Download patch

ref: 7f73792ef957c9592798f409eca2e7a4b6f0561f
parent: e37ff43eb678d0bf1ba45e957b1f653d1daf3795
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Feb 9 21:37:45 EST 2014

pc64: limit memory of per processor mmu freelist to 1MB

--- a/sys/src/9/pc64/mmu.c
+++ b/sys/src/9/pc64/mmu.c
@@ -29,7 +29,6 @@
 	Lock;
 	MMU	*free;
 
-	int	nshare;
 	int	nalloc;
 	int	nfree;
 } mmupool;
@@ -199,8 +198,6 @@
 			mmupool.free = p->next;
 			mmupool.nalloc += n;
 			mmupool.nfree += n-1;
-
-			mmupool.nshare = mmupool.nalloc / conf.nmach;
 		}
 		unlock(&mmupool);
 	}
@@ -357,7 +354,7 @@
 	p = proc->mmutail;
 	if(p == nil)
 		return;
-	if(m->mmucount < mmupool.nshare){
+	if(m->mmucount+proc->mmucount < 256){
 		p->next = m->mmufree;
 		m->mmufree = proc->mmuhead;
 		m->mmucount += proc->mmucount;