From 5850fa3e42bd2bd0b623fe953c3e90d17624dbff Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 16 Feb 2004 03:43:57 +0000 Subject: Correct a long-standing race condition in vm_contig_launder() that could result in a panic "vm_page_cache: caching a dirty page, ...": Access to the page must be restricted or removed before calling vm_page_cache(). This race condition is identical in nature to that which was addressed by vm_pageout.c's revision 1.251 and vm_page.c's revision 1.275. MFC after: 7 days --- sys/vm/vm_contig.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys') diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index fcdd45d08446..311a87a50252 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -105,6 +105,8 @@ vm_contig_launder(int queue) return (TRUE); } vm_page_test_dirty(m); + if (m->dirty == 0 && m->busy == 0 && m->hold_count == 0) + pmap_remove_all(m); if (m->dirty) { object = m->object; if (object->type == OBJT_VNODE) { -- cgit v1.3