From owner-svn-src-head@FreeBSD.ORG Sat Jan 1 17:39:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FFE3106566B; Sat, 1 Jan 2011 17:39:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8E68FC1D; Sat, 1 Jan 2011 17:39:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p01Hdcjm017188; Sat, 1 Jan 2011 17:39:38 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p01Hdchb017186; Sat, 1 Jan 2011 17:39:38 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101011739.p01Hdchb017186@svn.freebsd.org> From: Alan Cox Date: Sat, 1 Jan 2011 17:39:38 +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: r216874 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jan 2011 17:39:38 -0000 Author: alc Date: Sat Jan 1 17:39:38 2011 New Revision: 216874 URL: http://svn.freebsd.org/changeset/base/216874 Log: Make a couple refinements to r216799 and r216810. In particular, revise a comment and move it to its proper place. Reviewed by: kib Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Jan 1 16:59:05 2011 (r216873) +++ head/sys/vm/vm_object.c Sat Jan 1 17:39:38 2011 (r216874) @@ -755,6 +755,12 @@ vm_object_terminate(vm_object_t object) vm_object_destroy(object); } +/* + * Make the page read-only so that we can clear the object flags. However, if + * this is a nosync mmap then the object is likely to stay dirty so do not + * mess with the page and do not clear the object flags. Returns TRUE if the + * page should be flushed, and FALSE otherwise. + */ static boolean_t vm_object_page_remove_write(vm_page_t p, int flags, int *clearobjflags) { @@ -808,15 +814,7 @@ vm_object_page_clean(vm_object_t object, pagerflags |= (flags & OBJPC_INVAL) != 0 ? VM_PAGER_PUT_INVAL : 0; tend = (end == 0) ? object->size : end; - - /* - * Make the page read-only so we can then clear the object flags. - * - * However, if this is a nosync mmap then the object is likely to - * stay dirty so do not mess with the page and do not clear the - * object flags. - */ - clearobjflags = 1; + clearobjflags = start == 0 && tend == object->size; rescan: curgeneration = object->generation; @@ -847,7 +845,7 @@ rescan: VOP_FSYNC(vp, (pagerflags & VM_PAGER_PUT_SYNC) ? MNT_WAIT : 0); #endif - if (clearobjflags && start == 0 && tend == object->size) + if (clearobjflags) vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); }