From owner-svn-src-stable-9@FreeBSD.ORG Sat Sep 28 07:43:37 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 26A7641E; Sat, 28 Sep 2013 07:43:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 136792F2F; Sat, 28 Sep 2013 07:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8S7hark095937; Sat, 28 Sep 2013 07:43:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8S7haMc095936; Sat, 28 Sep 2013 07:43:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201309280743.r8S7haMc095936@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 28 Sep 2013 07:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r255924 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Sep 2013 07:43:37 -0000 Author: kib Date: Sat Sep 28 07:43:36 2013 New Revision: 255924 URL: http://svnweb.freebsd.org/changeset/base/255924 Log: MFC r255566: If the last page of the file is partially full and whole valid portion is invalidated, invalidate the whole page. Modified: stable/9/sys/vm/vm_page.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_page.c ============================================================================== --- stable/9/sys/vm/vm_page.c Sat Sep 28 07:04:03 2013 (r255923) +++ stable/9/sys/vm/vm_page.c Sat Sep 28 07:43:36 2013 (r255924) @@ -2637,12 +2637,19 @@ void vm_page_set_invalid(vm_page_t m, int base, int size) { vm_page_bits_t bits; + vm_object_t object; + object = m->object; VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); - bits = vm_page_bits(base, size); + if (object->type == OBJT_VNODE && base == 0 && IDX_TO_OFF(m->pindex) + + size >= object->un_pager.vnp.vnp_size) + bits = VM_PAGE_BITS_ALL; + else + bits = vm_page_bits(base, size); if (m->valid == VM_PAGE_BITS_ALL && bits != 0) pmap_remove_all(m); - KASSERT(!pmap_page_is_mapped(m), + KASSERT((bits == 0 && m->valid == VM_PAGE_BITS_ALL) || + !pmap_page_is_mapped(m), ("vm_page_set_invalid: page %p is mapped", m)); m->valid &= ~bits; m->dirty &= ~bits;