From owner-svn-src-all@freebsd.org Fri Dec 27 01:50:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 820BF1DEDA8; Fri, 27 Dec 2019 01:50:17 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47kVBx2t7bz4YSG; Fri, 27 Dec 2019 01:50:17 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59B5899D4; Fri, 27 Dec 2019 01:50:17 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBR1oHFJ071622; Fri, 27 Dec 2019 01:50:17 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBR1oHnD071621; Fri, 27 Dec 2019 01:50:17 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912270150.xBR1oHnD071621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Fri, 27 Dec 2019 01:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356109 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Fri, 27 Dec 2019 01:50:17 -0000 Author: jeff Date: Fri Dec 27 01:50:16 2019 New Revision: 356109 URL: https://svnweb.freebsd.org/changeset/base/356109 Log: Fix a pair of bugs introduced in r356002. When we reclaim physical pages we allocate them with VM_ALLOC_NOOBJ which means they are not busy. For now move the busy assert for the new page in vm_page_replace into the public api and out of the private api used by contig reclaim. Fix another issue where we would leak busy if the page could not be removed from pmap. Reported by: pho Discussed with: markj Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Dec 27 01:36:53 2019 (r356108) +++ head/sys/vm/vm_page.c Fri Dec 27 01:50:16 2019 (r356109) @@ -1751,7 +1751,6 @@ vm_page_replace_hold(vm_page_t mnew, vm_object_t objec bool dropped; VM_OBJECT_ASSERT_WLOCKED(object); - vm_page_assert_xbusied(mnew); vm_page_assert_xbusied(mold); KASSERT(mnew->object == NULL && (mnew->ref_count & VPRC_OBJREF) == 0, ("vm_page_replace: page %p already in object", mnew)); @@ -1795,6 +1794,8 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm vm_page_t mold) { + vm_page_assert_xbusied(mnew); + if (vm_page_replace_hold(mnew, object, pindex, mold)) vm_page_free(mold); } @@ -2793,6 +2794,7 @@ retry: */ if (object->ref_count != 0 && !vm_page_try_remove_all(m)) { + vm_page_xunbusy(m); vm_page_free(m_new); error = EBUSY; goto unlock;