changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: pc kernel: remove countpagerefs() (thanks BurnZeZ)

changeset 7201: b73a652b1030
parent 7200: 4b67ffcd2c61
child 7202: 140274f6f1c2
author: cinap_lenrek@felloff.net
date: Fri, 03 May 2019 23:52:49 +0200
files: sys/src/9/pc/mmu.c
description: pc kernel: remove countpagerefs() (thanks BurnZeZ)

forgot to commit this...
     1.1--- a/sys/src/9/pc/mmu.c
     1.2+++ b/sys/src/9/pc/mmu.c
     1.3@@ -972,97 +972,6 @@ paddr(void *v)
     1.4  * More debugging.
     1.5  */
     1.6 void
     1.7-countpagerefs(ulong *ref, int print)
     1.8-{
     1.9-	int i, n;
    1.10-	Mach *mm;
    1.11-	Page *pg;
    1.12-	Proc *p;
    1.13-	
    1.14-	n = 0;
    1.15-	for(i=0; i<conf.nproc; i++){
    1.16-		p = proctab(i);
    1.17-		if(p->mmupdb){
    1.18-			if(print){
    1.19-				if(ref[pagenumber(p->mmupdb)])
    1.20-					iprint("page %#.8lux is proc %d (pid %lud) pdb\n",
    1.21-						p->mmupdb->pa, i, p->pid);
    1.22-				continue;
    1.23-			}
    1.24-			if(ref[pagenumber(p->mmupdb)]++ == 0)
    1.25-				n++;
    1.26-			else
    1.27-				iprint("page %#.8lux is proc %d (pid %lud) pdb but has other refs!\n",
    1.28-					p->mmupdb->pa, i, p->pid);
    1.29-		}
    1.30-		if(p->kmaptable){
    1.31-			if(print){
    1.32-				if(ref[pagenumber(p->kmaptable)])
    1.33-					iprint("page %#.8lux is proc %d (pid %lud) kmaptable\n",
    1.34-						p->kmaptable->pa, i, p->pid);
    1.35-				continue;
    1.36-			}
    1.37-			if(ref[pagenumber(p->kmaptable)]++ == 0)
    1.38-				n++;
    1.39-			else
    1.40-				iprint("page %#.8lux is proc %d (pid %lud) kmaptable but has other refs!\n",
    1.41-					p->kmaptable->pa, i, p->pid);
    1.42-		}
    1.43-		for(pg=p->mmuused; pg; pg=pg->next){
    1.44-			if(print){
    1.45-				if(ref[pagenumber(pg)])
    1.46-					iprint("page %#.8lux is on proc %d (pid %lud) mmuused\n",
    1.47-						pg->pa, i, p->pid);
    1.48-				continue;
    1.49-			}
    1.50-			if(ref[pagenumber(pg)]++ == 0)
    1.51-				n++;
    1.52-			else
    1.53-				iprint("page %#.8lux is on proc %d (pid %lud) mmuused but has other refs!\n",
    1.54-					pg->pa, i, p->pid);
    1.55-		}
    1.56-		for(pg=p->mmufree; pg; pg=pg->next){
    1.57-			if(print){
    1.58-				if(ref[pagenumber(pg)])
    1.59-					iprint("page %#.8lux is on proc %d (pid %lud) mmufree\n",
    1.60-						pg->pa, i, p->pid);
    1.61-				continue;
    1.62-			}
    1.63-			if(ref[pagenumber(pg)]++ == 0)
    1.64-				n++;
    1.65-			else
    1.66-				iprint("page %#.8lux is on proc %d (pid %lud) mmufree but has other refs!\n",
    1.67-					pg->pa, i, p->pid);
    1.68-		}
    1.69-	}
    1.70-	if(!print)
    1.71-		iprint("%d pages in proc mmu\n", n);
    1.72-	n = 0;
    1.73-	for(i=0; i<conf.nmach; i++){
    1.74-		mm = MACHP(i);
    1.75-		for(pg=mm->pdbpool; pg; pg=pg->next){
    1.76-			if(print){
    1.77-				if(ref[pagenumber(pg)])
    1.78-					iprint("page %#.8lux is in cpu%d pdbpool\n",
    1.79-						pg->pa, i);
    1.80-				continue;
    1.81-			}
    1.82-			if(ref[pagenumber(pg)]++ == 0)
    1.83-				n++;
    1.84-			else
    1.85-				iprint("page %#.8lux is in cpu%d pdbpool but has other refs!\n",
    1.86-					pg->pa, i);
    1.87-		}
    1.88-	}
    1.89-	if(!print){
    1.90-		iprint("%d pages in mach pdbpools\n", n);
    1.91-		for(i=0; i<conf.nmach; i++)
    1.92-			iprint("cpu%d: %d pdballoc, %d pdbfree\n",
    1.93-				i, MACHP(i)->pdballoc, MACHP(i)->pdbfree);
    1.94-	}
    1.95-}
    1.96-
    1.97-void
    1.98 checkfault(ulong, ulong)
    1.99 {
   1.100 }