diff options
author | alc <alc@FreeBSD.org> | 2004-05-22 04:53:51 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-05-22 04:53:51 +0000 |
commit | 5d0912f6d822aa43b6aee5b532f4748d03c89146 (patch) | |
tree | 6d85a1a2ab10a2464008e25a57d32d46bc5a5096 /sys/vm/vm_page.c | |
parent | 29c76b12014e9524479c1b3617da95f5acb719e3 (diff) | |
download | FreeBSD-src-5d0912f6d822aa43b6aee5b532f4748d03c89146.zip FreeBSD-src-5d0912f6d822aa43b6aee5b532f4748d03c89146.tar.gz |
To date, unwiring a fictitious page has produced a panic. The reason
being that PHYS_TO_VM_PAGE() returns the wrong vm_page for fictitious
pages but unwiring uses PHYS_TO_VM_PAGE(). The resulting panic
reported an unexpected wired count. Rather than attempting to fix
PHYS_TO_VM_PAGE(), this fix takes advantage of the properties of
fictitious pages. Specifically, fictitious pages will never be
completely unwired. Therefore, we can keep a fictitious page's wired
count forever set to one and thereby avoid the use of
PHYS_TO_VM_PAGE() when we know that we're working with a fictitious
page, just not which one.
In collaboration with: green@, tegge@
PR: kern/29915
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r-- | sys/vm/vm_page.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 24a7de9..a45259e 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1167,6 +1167,8 @@ vm_page_wire(vm_page_t m) */ s = splvm(); mtx_assert(&vm_page_queue_mtx, MA_OWNED); + if (m->flags & PG_FICTITIOUS) + return; if (m->wire_count == 0) { if ((m->flags & PG_UNMANAGED) == 0) vm_pageq_remove(m); @@ -1212,6 +1214,8 @@ vm_page_unwire(vm_page_t m, int activate) s = splvm(); mtx_assert(&vm_page_queue_mtx, MA_OWNED); + if (m->flags & PG_FICTITIOUS) + return; if (m->wire_count > 0) { m->wire_count--; if (m->wire_count == 0) { |