From 154b3dd2ea577a9298e626439aac91c581fdd97f Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 4 Jan 2012 16:04:20 +0000 Subject: [PATCH 59/65] Do not restart the scan in vm_object_page_clean() on the object generation change if requested mode is async. The object generation is only changed when the object is marked as OBJ_MIGHTBEDIRTY. For async mode it is enough to write each dirty page, not to make a guarantee that all pages are cleared after the vm_object_page_clean() returned. Diagnosed by: truckman Tested by: flo Reviewed by: alc, truckman MFC after: 2 weeks git-svn-id: http://svn.freebsd.org/base/head@229495 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f (cherry picked from commit 6d7774d331f4ebb7833cec41b14ad15efd503e64) Signed-off-by: Xin Li --- sys/vm/vm_object.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 7389d0e..70003e3 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -840,8 +840,12 @@ rescan: if (p->valid == 0) continue; if (vm_page_sleep_if_busy(p, TRUE, "vpcwai")) { - if (object->generation != curgeneration) - goto rescan; + if (object->generation != curgeneration) { + if ((flags & OBJPC_SYNC) != 0) + goto rescan; + else + clearobjflags = 0; + } np = vm_page_find_least(object, pi); continue; } @@ -850,8 +854,12 @@ rescan: n = vm_object_page_collect_flush(object, p, pagerflags, flags, &clearobjflags); - if (object->generation != curgeneration) - goto rescan; + if (object->generation != curgeneration) { + if ((flags & OBJPC_SYNC) != 0) + goto rescan; + else + clearobjflags = 0; + } /* * If the VOP_PUTPAGES() did a truncated write, so -- 1.7.8.3