From owner-svn-src-all@freebsd.org Tue Mar 13 18:27:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3AD2F3F7B3; Tue, 13 Mar 2018 18:27:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8E76D86B; Tue, 13 Mar 2018 18:27:24 +0000 (UTC) (envelope-from kib@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 376C41D5D1; Tue, 13 Mar 2018 18:27:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DIROD2066383; Tue, 13 Mar 2018 18:27:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DIROIN066382; Tue, 13 Mar 2018 18:27:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803131827.w2DIROIN066382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 13 Mar 2018 18:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330871 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 330871 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.25 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: Tue, 13 Mar 2018 18:27:25 -0000 Author: kib Date: Tue Mar 13 18:27:23 2018 New Revision: 330871 URL: https://svnweb.freebsd.org/changeset/base/330871 Log: Revert the chunk from r330410 in vm_page_reclaim_run(). There, the pages freed might be managed but the page's lock is not owned. For KPI correctness, the page lock is requried around the call to vm_page_free_prep(), which is asserted. Reclaim loop already did the work which could be done by vm_page_free_prep(), so the lock is not needed and the only consequence of not owning it is the assert trigger. Instead of adding the locking to satisfy the assert, revert to the code that calls vm_page_free_phys() directly. Reported by: pho Discussed with: jeff Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Mar 13 18:24:21 2018 (r330870) +++ head/sys/vm/vm_page.c Tue Mar 13 18:27:23 2018 (r330871) @@ -2538,7 +2538,17 @@ unlock: } if (m_mtx != NULL) mtx_unlock(m_mtx); - vm_page_free_pages_toq(&free, false); + if ((m = SLIST_FIRST(&free)) != NULL) { + vmd = VM_DOMAIN(domain); + vm_domain_free_lock(vmd); + do { + MPASS(vm_phys_domain(m) == domain); + SLIST_REMOVE_HEAD(&free, plinks.s.ss); + vm_page_free_phys(vmd, m); + } while ((m = SLIST_FIRST(&free)) != NULL); + vm_domain_free_wakeup(vmd); + vm_domain_free_unlock(vmd); + } return (error); }