Fix a 'panic: vm_page_cache: caching a dirty page' assertion. Even though
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 6 Dec 2007 22:25:49 +0000 (22:25 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 6 Dec 2007 22:25:49 +0000 (22:25 +0000)
commitc9ec86b3d18d621e08d7e976f1f48d01c75f6ada
treef16ca80a014c5bd5a67a00b97427d71e424016f3
parent7a313817bdc93a00f46926178cd6911e958ec9e5
Fix a 'panic: vm_page_cache: caching a dirty page' assertion.  Even though
callers of vm_page_cache() check m->dirty and test the PTE's in the page's
pmap, it is still possible on a SMP system for a process running in usermode
on a different cpu to dirty the page after these tests, but before the page
has been removed from various pagetables.

The solution is to test m->dirty again after vm_page_cache() removes the
page from its associated page tables and silently deactivate the page instead
of moving it to the cache if the page is found to be dirty.

Reported-by: Peter Avalos <pavalos@theshell.com>
sys/vm/vm_page.c