diff options
| author | chs <chs@NetBSD.org> | 2001-12-13 04:39:50 +0000 |
|---|---|---|
| committer | chs <chs@NetBSD.org> | 2001-12-13 04:39:50 +0000 |
| commit | 2dfd15933eb4b5896709d82dc0d557f88e1231c8 (patch) | |
| tree | 91496cefa0a34f18a2b00044b9afcb2221d6bca7 /sys/arch/atari | |
| parent | 94ff9810676a694793e25fbd8c4b11e38310f516 (diff) | |
change the reference-counting of PT pages to start from zero instead of
one, so that we don't mess up the global count of wired pages by having
the page's wire_count be non-zero when we free the page.
pointed out by Michael Hitch.
Diffstat (limited to 'sys/arch/atari')
| -rw-r--r-- | sys/arch/atari/atari/pmap.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/arch/atari/atari/pmap.c b/sys/arch/atari/atari/pmap.c index 78605c69e2d..19ff3452899 100644 --- a/sys/arch/atari/atari/pmap.c +++ b/sys/arch/atari/atari/pmap.c @@ -2039,7 +2039,7 @@ pmap_remove_mapping(pmap, va, pte, flags) * If reference count drops to 1, and we're not instructed * to keep it around, free the PT page. */ - if (refs == 1 && (flags & PRM_KEEPPTPAGE) == 0) { + if (refs == 0 && (flags & PRM_KEEPPTPAGE) == 0) { #ifdef DIAGNOSTIC struct pv_entry *pv; #endif @@ -2562,7 +2562,6 @@ pmap_enter_ptpage(pmap, va) UVM_PGA_ZERO)) == NULL) { uvm_wait("ptpage"); } - pg->wire_count = 1; pg->flags &= ~(PG_BUSY|PG_FAKE); UVM_PAGE_OWN(pg, NULL); ptpa = VM_PAGE_TO_PHYS(pg); @@ -2716,8 +2715,8 @@ pmap_check_wiring(str, va) pa = pmap_pte_pa(pmap_pte(pmap_kernel(), va)); pg = PHYS_TO_VM_PAGE(pa); - if (pg->wire_count < 1) { - printf("*%s*: 0x%lx: wire count %d\n", str, va, pg->wire_count); + if (pg->wire_count >= PAGE_SIZE / sizeof(pt_entry_t)) { + panic("*%s*: 0x%lx: wire count %d", str, va, pg->wire_count); return; } @@ -2725,8 +2724,8 @@ pmap_check_wiring(str, va) for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++) if (*pte) count++; - if ((pg->wire_count - 1) != count) - printf("*%s*: 0x%lx: w%d/a%d\n", - str, va, (pg->wire_count - 1), count); + if (pg->wire_count != count) + panic("*%s*: 0x%lx: w%d/a%d", + str, va, pg->wire_count, count); } #endif |
