ref: 763b41bde1a4c6c424a57875f20a03d8ca77c6bf
parent: d69b6c597e4220183f1fab381660adf370f5de79
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri May 3 19:52:49 EDT 2019
pc kernel: remove countpagerefs() (thanks BurnZeZ) forgot to commit this...
--- a/sys/src/9/pc/mmu.c
+++ b/sys/src/9/pc/mmu.c
@@ -972,97 +972,6 @@
* More debugging.
*/
void
-countpagerefs(ulong *ref, int print)
-{- int i, n;
- Mach *mm;
- Page *pg;
- Proc *p;
-
- n = 0;
- for(i=0; i<conf.nproc; i++){- p = proctab(i);
- if(p->mmupdb){- if(print){- if(ref[pagenumber(p->mmupdb)])
- iprint("page %#.8lux is proc %d (pid %lud) pdb\n",- p->mmupdb->pa, i, p->pid);
- continue;
- }
- if(ref[pagenumber(p->mmupdb)]++ == 0)
- n++;
- else
- iprint("page %#.8lux is proc %d (pid %lud) pdb but has other refs!\n",- p->mmupdb->pa, i, p->pid);
- }
- if(p->kmaptable){- if(print){- if(ref[pagenumber(p->kmaptable)])
- iprint("page %#.8lux is proc %d (pid %lud) kmaptable\n",- p->kmaptable->pa, i, p->pid);
- continue;
- }
- if(ref[pagenumber(p->kmaptable)]++ == 0)
- n++;
- else
- iprint("page %#.8lux is proc %d (pid %lud) kmaptable but has other refs!\n",- p->kmaptable->pa, i, p->pid);
- }
- for(pg=p->mmuused; pg; pg=pg->next){- if(print){- if(ref[pagenumber(pg)])
- iprint("page %#.8lux is on proc %d (pid %lud) mmuused\n",- pg->pa, i, p->pid);
- continue;
- }
- if(ref[pagenumber(pg)]++ == 0)
- n++;
- else
- iprint("page %#.8lux is on proc %d (pid %lud) mmuused but has other refs!\n",- pg->pa, i, p->pid);
- }
- for(pg=p->mmufree; pg; pg=pg->next){- if(print){- if(ref[pagenumber(pg)])
- iprint("page %#.8lux is on proc %d (pid %lud) mmufree\n",- pg->pa, i, p->pid);
- continue;
- }
- if(ref[pagenumber(pg)]++ == 0)
- n++;
- else
- iprint("page %#.8lux is on proc %d (pid %lud) mmufree but has other refs!\n",- pg->pa, i, p->pid);
- }
- }
- if(!print)
- iprint("%d pages in proc mmu\n", n);- n = 0;
- for(i=0; i<conf.nmach; i++){- mm = MACHP(i);
- for(pg=mm->pdbpool; pg; pg=pg->next){- if(print){- if(ref[pagenumber(pg)])
- iprint("page %#.8lux is in cpu%d pdbpool\n",- pg->pa, i);
- continue;
- }
- if(ref[pagenumber(pg)]++ == 0)
- n++;
- else
- iprint("page %#.8lux is in cpu%d pdbpool but has other refs!\n",- pg->pa, i);
- }
- }
- if(!print){- iprint("%d pages in mach pdbpools\n", n);- for(i=0; i<conf.nmach; i++)
- iprint("cpu%d: %d pdballoc, %d pdbfree\n",- i, MACHP(i)->pdballoc, MACHP(i)->pdbfree);
- }
-}
-
-void
checkfault(ulong, ulong)
{}
--
⑨