From owner-svn-src-all@FreeBSD.ORG Wed Jan 4 16:04:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2767106564A; Wed, 4 Jan 2012 16:04:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C177A8FC23; Wed, 4 Jan 2012 16:04:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q04G4KBC085519; Wed, 4 Jan 2012 16:04:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q04G4KoP085517; Wed, 4 Jan 2012 16:04:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201041604.q04G4KoP085517@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 4 Jan 2012 16:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229495 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 16:04:20 -0000 Author: kib Date: Wed Jan 4 16:04:20 2012 New Revision: 229495 URL: http://svn.freebsd.org/changeset/base/229495 Log: 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 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Jan 4 16:02:52 2012 (r229494) +++ head/sys/vm/vm_object.c Wed Jan 4 16:04:20 2012 (r229495) @@ -841,8 +841,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; } @@ -851,8 +855,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