From 82a797da707881fa3188cab7424738cd07fe9c92 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 16 Apr 2015 16:30:14 +0200 Subject: [PATCH] kernel: leave shared, physical and fixed segments alone in killbig() --- sys/src/9/port/proc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/src/9/port/proc.c b/sys/src/9/port/proc.c index 0f5f6f992..111fec5fa 100644 --- a/sys/src/9/port/proc.c +++ b/sys/src/9/port/proc.c @@ -1552,11 +1552,17 @@ killbig(char *why) kp->procctl = Proc_exitbig; for(i = 0; i < NSEG; i++) { s = kp->seg[i]; - if(s != nil) { - qlock(s); - mfreeseg(s, s->base, (s->top - s->base)/BY2PG); - qunlock(s); + if(s == nil) + continue; + switch(s->type & SG_TYPE){ + case SG_SHARED: + case SG_PHYSICAL: + case SG_FIXED: + continue; } + qlock(s); + mfreeseg(s, s->base, (s->top - s->base)/BY2PG); + qunlock(s); } qunlock(&kp->seglock); }