diff --git a/sys/src/9/mtx/mmu.c b/sys/src/9/mtx/mmu.c index 791c968da..c4030ce8f 100644 --- a/sys/src/9/mtx/mmu.c +++ b/sys/src/9/mtx/mmu.c @@ -229,11 +229,6 @@ checkmmu(uintptr, uintptr) { } -void -countpagerefs(ulong*, int) -{ -} - /* * Return the number of bytes that can be accessed via KADDR(pa). * If pa is not a valid argument to KADDR, return 0. diff --git a/sys/src/9/pc64/mmu.c b/sys/src/9/pc64/mmu.c index 45bc76d40..9261354e8 100644 --- a/sys/src/9/pc64/mmu.c +++ b/sys/src/9/pc64/mmu.c @@ -468,12 +468,6 @@ cankaddr(uintptr pa) return -KZERO - pa; } -void -countpagerefs(ulong *ref, int print) -{ - USED(ref, print); -} - KMap* kmap(Page *page) { diff --git a/sys/src/9/port/page.c b/sys/src/9/port/page.c index 6e74cbe4e..582ebb786 100644 --- a/sys/src/9/port/page.c +++ b/sys/src/9/port/page.c @@ -399,119 +399,3 @@ freepte(Segment *s, Pte *p) } free(p); } - -ulong -pagenumber(Page *p) -{ - return p-palloc.pages; -} - -void -checkpagerefs(void) -{ - int s; - ulong i, np, nwrong; - ulong *ref; - - np = palloc.user; - ref = malloc(np*sizeof ref[0]); - if(ref == nil){ - print("checkpagerefs: out of memory\n"); - return; - } - - /* - * This may not be exact if there are other processes - * holding refs to pages on their stacks. The hope is - * that if you run it on a quiescent system it will still - * be useful. - */ - s = splhi(); - lock(&palloc); - countpagerefs(ref, 0); - portcountpagerefs(ref, 0); - nwrong = 0; - for(i=0; imark avoids double-counting. - */ - n = 0; - ns = 0; - for(i=0; iseg[j]; - if(s != nil) - s->mark = 0; - } - } - for(i=0; iseg[j]; - if(s == nil || s->mark++) - continue; - if((s->type&SG_TYPE) == SG_PHYSICAL) - continue; - ns++; - for(k=0; kmapsize; k++){ - pte = s->map[k]; - if(pte == nil) - continue; - for(pg = pte->first; pg <= pte->last; pg++){ - entry = *pg; - if(pagedout(entry)) - continue; - if(print){ - if(ref[pagenumber(entry)]) - iprint("page %#p in segment %#p\n", entry->pa, s); - continue; - } - if(ref[pagenumber(entry)]++ == 0) - n++; - } - } - } - } - if(!print){ - iprint("%lud pages in %lud segments\n", n, ns); - for(i=0; iseg[j]; - if(s == nil) - continue; - if(s->ref != s->mark){ - iprint("segment %#p (used by proc %lud pid %lud) has bad ref count %lud actual %lud\n", - s, i, p->pid, s->ref, s->mark); - } - } - } - } -} - diff --git a/sys/src/9/port/portfns.h b/sys/src/9/port/portfns.h index 6d41cd03a..c92706888 100644 --- a/sys/src/9/port/portfns.h +++ b/sys/src/9/port/portfns.h @@ -207,7 +207,6 @@ Block* padblock(Block*, int); void pagechaindone(void); void pagechainhead(Page*); void pageinit(void); -ulong pagenumber(Page*); ulong pagereclaim(Image*, ulong); void panic(char*, ...); Cmdbuf* parsecmd(char *a, int n); diff --git a/sys/src/9/port/sysproc.c b/sys/src/9/port/sysproc.c index 5a20316f1..705dbf415 100644 --- a/sys/src/9/port/sysproc.c +++ b/sys/src/9/port/sysproc.c @@ -9,15 +9,11 @@ #include -extern void checkpages(void); -extern void checkpagerefs(void); - uintptr sysr1(va_list) { if(!iseve()) error(Eperm); - checkpagerefs(); return 0; } diff --git a/sys/src/9/ppc/mmu.c b/sys/src/9/ppc/mmu.c index a47bf2d56..88ef49e2d 100644 --- a/sys/src/9/ppc/mmu.c +++ b/sys/src/9/ppc/mmu.c @@ -255,11 +255,6 @@ checkmmu(uintptr, uintptr) { } -void -countpagerefs(ulong*, int) -{ -} - /* * Return the number of bytes that can be accessed via KADDR(pa). * If pa is not a valid argument to KADDR, return 0. diff --git a/sys/src/9/sgi/mmu.c b/sys/src/9/sgi/mmu.c index 8af2956e2..3d7e9f569 100644 --- a/sys/src/9/sgi/mmu.c +++ b/sys/src/9/sgi/mmu.c @@ -461,11 +461,6 @@ checkmmu(ulong, ulong) { } -void -countpagerefs(ulong*, int) -{ -} - /* * Return the number of bytes that can be accessed via KADDR(pa). * If pa is not a valid argument to KADDR, return 0. diff --git a/sys/src/9/xen/mmu.c b/sys/src/9/xen/mmu.c index c293fdaeb..1a5c3d067 100644 --- a/sys/src/9/xen/mmu.c +++ b/sys/src/9/xen/mmu.c @@ -508,16 +508,6 @@ mmukmapsync(ulong va) return 0; } -/* - * More debugging. - */ -void -countpagerefs(ulong *ref, int print) -{ - USED(ref); - USED(print); -} - /* * Return the number of bytes that can be accessed via KADDR(pa). * If pa is not a valid argument to KADDR, return 0. diff --git a/sys/src/9/zynq/mmu.c b/sys/src/9/zynq/mmu.c index e3e63bd3d..918f930b5 100644 --- a/sys/src/9/zynq/mmu.c +++ b/sys/src/9/zynq/mmu.c @@ -242,12 +242,6 @@ mmurelease(Proc *proc) proc->mmufree = nil; } -void -countpagerefs(ulong *, int) -{ - print("countpagerefs\n"); -} - uintptr paddr(void *v) {