From owner-svn-src-stable-10@freebsd.org Sat Aug 1 03:37:02 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 232B49AFB3E; Sat, 1 Aug 2015 03:37:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06D8D29F1; Sat, 1 Aug 2015 03:37:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t713b1uq097331; Sat, 1 Aug 2015 03:37:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t713b1gm097328; Sat, 1 Aug 2015 03:37:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201508010337.t713b1gm097328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 1 Aug 2015 03:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r286145 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2015 03:37:02 -0000 Author: kib Date: Sat Aug 1 03:37:00 2015 New Revision: 286145 URL: https://svnweb.freebsd.org/changeset/base/286145 Log: MFC r285878: Revert r173708's modifications to vm_object_page_remove(). This fixes inconsistencies encountered by vm_object_unwire() or by the buffer cache when the file is truncated. Modified: stable/10/sys/vm/vm_object.c stable/10/sys/vm/vm_object.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Sat Aug 1 01:29:55 2015 (r286144) +++ stable/10/sys/vm/vm_object.c Sat Aug 1 03:37:00 2015 (r286145) @@ -1063,9 +1063,9 @@ vm_object_sync(vm_object_t object, vm_oo */ flags = OBJPR_NOTMAPPED; else if (old_msync) - flags = OBJPR_NOTWIRED; + flags = 0; else - flags = OBJPR_CLEANONLY | OBJPR_NOTWIRED; + flags = OBJPR_CLEANONLY; vm_object_page_remove(object, OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), flags); } @@ -1894,7 +1894,6 @@ vm_object_page_remove(vm_object_t object int options) { vm_page_t p, next; - int wirings; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_UNMANAGED) == 0 || @@ -1928,15 +1927,9 @@ again: VM_OBJECT_WLOCK(object); goto again; } - if ((wirings = p->wire_count) != 0 && - (wirings = pmap_page_wired_mappings(p)) != p->wire_count) { - if ((options & (OBJPR_NOTWIRED | OBJPR_NOTMAPPED)) == - 0) { + if (p->wire_count != 0) { + if ((options & OBJPR_NOTMAPPED) == 0) pmap_remove_all(p); - /* Account for removal of wired mappings. */ - if (wirings != 0) - p->wire_count -= wirings; - } if ((options & OBJPR_CLEANONLY) == 0) { p->valid = 0; vm_page_undirty(p); @@ -1957,19 +1950,8 @@ again: if (p->dirty) goto next; } - if ((options & OBJPR_NOTMAPPED) == 0) { - if ((options & OBJPR_NOTWIRED) != 0 && wirings != 0) - goto next; + if ((options & OBJPR_NOTMAPPED) == 0) pmap_remove_all(p); - /* Account for removal of wired mappings. */ - if (wirings != 0) { - KASSERT(p->wire_count == wirings, - ("inconsistent wire count %d %d %p", - p->wire_count, wirings, p)); - p->wire_count = 0; - atomic_subtract_int(&cnt.v_wire_count, 1); - } - } vm_page_free(p); next: vm_page_unlock(p); Modified: stable/10/sys/vm/vm_object.h ============================================================================== --- stable/10/sys/vm/vm_object.h Sat Aug 1 01:29:55 2015 (r286144) +++ stable/10/sys/vm/vm_object.h Sat Aug 1 03:37:00 2015 (r286145) @@ -207,7 +207,6 @@ struct vm_object { */ #define OBJPR_CLEANONLY 0x1 /* Don't remove dirty pages. */ #define OBJPR_NOTMAPPED 0x2 /* Don't unmap pages. */ -#define OBJPR_NOTWIRED 0x4 /* Don't remove wired pages. */ TAILQ_HEAD(object_q, vm_object);