From: Paul Mackerras Date: Fri, 22 Jan 1993 00:00:00 +0000 (+0000) Subject: PAGES LOST IN VM SYSTEM X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/d7251e01e40f012d280e7e6b62a389fc8614e766 PAGES LOST IN VM SYSTEM The bug is that the call to vm_page_deactivate() at line 531 of vm_fault.c does not put the (now no longer needed) page back on the inactive list, because vm_page_deactivate() only does anything with active pages. Consequently, the page is then not on the active, inactive or free lists and is effectively not available for use. (It is not lost forever, though, because it is still on its object's page queue.) AUTHOR: Paul Mackerras (paulus@cs.anu.edu.au) 386BSD-Patchkit: patch00074 --- diff --git a/usr/src/sys.386bsd/vm/vm_page.c b/usr/src/sys.386bsd/vm/vm_page.c index 0e794dbfb8..b8bab152a6 100644 --- a/usr/src/sys.386bsd/vm/vm_page.c +++ b/usr/src/sys.386bsd/vm/vm_page.c @@ -60,6 +60,14 @@ * * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. + * + * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE + * -------------------- ----- ---------------------- + * CURRENT PATCH LEVEL: 1 00074 + * -------------------- ----- ---------------------- + * + * 22 Jan 93 Paul Mackerras Fixed bug where pages got lost + * */ /* @@ -687,15 +695,22 @@ void vm_page_deactivate(m) /* * Only move active pages -- ignore locked or already * inactive ones. + * + * XXX: sometimes we get pages which aren't wired down + * or on any queue - we need to put them on the inactive + * queue also, otherwise we lose track of them. + * Paul Mackerras (paulus@cs.anu.edu.au) 9-Jan-93. */ - if (m->active) { + if (!m->inactive && m->wire_count == 0) { pmap_clear_reference(VM_PAGE_TO_PHYS(m)); - queue_remove(&vm_page_queue_active, m, vm_page_t, pageq); + if (m->active) { + queue_remove(&vm_page_queue_active, m, vm_page_t, pageq); + m->active = FALSE; + vm_page_active_count--; + } queue_enter(&vm_page_queue_inactive, m, vm_page_t, pageq); - m->active = FALSE; m->inactive = TRUE; - vm_page_active_count--; vm_page_inactive_count++; if (pmap_is_modified(VM_PAGE_TO_PHYS(m))) m->clean = FALSE;