From owner-svn-src-head@freebsd.org Tue Feb 18 00:02:22 2020 Return-Path: Delivered-To: svn-src-head@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 8888024B372; Tue, 18 Feb 2020 00:02:22 +0000 (UTC) (envelope-from chs@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 48M1Hx49MJz3D82; Tue, 18 Feb 2020 00:02:21 +0000 (UTC) (envelope-from chs@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 6FF27F3D7; Tue, 18 Feb 2020 00:02:21 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01I02LGt009839; Tue, 18 Feb 2020 00:02:21 GMT (envelope-from chs@FreeBSD.org) Received: (from chs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01I02LH7009838; Tue, 18 Feb 2020 00:02:21 GMT (envelope-from chs@FreeBSD.org) Message-Id: <202002180002.01I02LH7009838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chs set sender to chs@FreeBSD.org using -f From: Chuck Silvers Date: Tue, 18 Feb 2020 00:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358058 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: chs X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 358058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Tue, 18 Feb 2020 00:02:22 -0000 Author: chs Date: Tue Feb 18 00:02:20 2020 New Revision: 358058 URL: https://svnweb.freebsd.org/changeset/base/358058 Log: amd64: keep PTE bitmasks in sync with target pmap during pv reclaim in reclaim_pv_chunk_domain(), when we switch to a new target pmap from which we are trying to reclaim a pv chunk, always update the current PTE bitmasks to match. Reviewed by: kib, markj Approved by: imp (mentor) Sponsored by: Netflix Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Feb 18 00:01:18 2020 (r358057) +++ head/sys/amd64/amd64/pmap.c Tue Feb 18 00:02:20 2020 (r358058) @@ -4298,7 +4298,7 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl struct spglist free; uint64_t inuse; int bit, field, freed; - bool start_di; + bool start_di, restart; PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL")); @@ -4343,6 +4343,7 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl * corresponding pmap is locked. */ if (pmap != next_pmap) { + restart = false; reclaim_pv_chunk_leave_pmap(pmap, locked_pmap, start_di); pmap = next_pmap; @@ -4353,13 +4354,13 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl if (start_di) pmap_delayed_invl_start(); mtx_lock(&pvc->pvc_lock); - continue; + restart = true; } else if (pmap != locked_pmap) { if (PMAP_TRYLOCK(pmap)) { if (start_di) pmap_delayed_invl_start(); mtx_lock(&pvc->pvc_lock); - continue; + restart = true; } else { pmap = NULL; /* pmap is not locked */ mtx_lock(&pvc->pvc_lock); @@ -4375,6 +4376,8 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl PG_A = pmap_accessed_bit(pmap); PG_M = pmap_modified_bit(pmap); PG_RW = pmap_rw_bit(pmap); + if (restart) + continue; } /*