From nobody Thu Nov 02 18:47:46 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SLtD23VtTz503l3; Thu, 2 Nov 2023 18:47:46 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SLtD22wrsz3Wgy; Thu, 2 Nov 2023 18:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698950866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xZmR45Js+h7M3SCmYgMpGDi4JFM/bloQ03X5FkQ624o=; b=H6ri2stbHm8RI1ZdwKrQ23K3p+z1azRhaVGdtsDp7u11yhhEqEvl5mLDLWtQJbhjtxKOv+ qm/OOpZF0UAM7lSycAkGBQtmneVfbe4te+E8vnpTHogREEIOdpzqnmyJJkMULP+Gnr8eeo 1fKf0KAtCb4V4aX9yBdsPPsOMa2nzr9T5pkRydvsPUS+f4cfzRea2cRLw1jrsiw/PPb/+Y zaCCPArIxExtLgq259lYaQ34/qt+zmgnNf9Tv45F7MKZexVs0G1H2mHEG2Zv7yXOvqw3lw OqWD2Yh4L3mfrll0OrBMOwBAS1cRNQutaPoVVNKLclpUGWFrZqGRDj7JxhVT4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698950866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xZmR45Js+h7M3SCmYgMpGDi4JFM/bloQ03X5FkQ624o=; b=c3ksOYw51+yfdtw0ZMWtbJ6MG6j7H+yLnFxzY9Lupt8JR4q5Z0xGElizsExicLxGN+sZzO Fg0Pk0iy5zac6zAHL8oOJgN9Yr1c0nbJtoOzu0FDjXuSoboj+COCrf1VzZS9uERZGRu8fa YYIU5OtxvFUbJZk/qf7krDuDFhFGl0EG5Kn7Gung00FGTwDIyEJ8aRCpdZIiTIjqBXFuDD Wlo48NmqAyS2D1zB+i+M7kDB4Rx+Zx48OjRoJj2u3zvWwG0i41gzHgj0lgxnErKbAejb+R ip5Y2GUqOYsO7E00LIjm0/HrYA9K+jvpJXOK5a+Taq1FBv24yr3fGanzKtlihg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698950866; a=rsa-sha256; cv=none; b=CGt69fPyGzjk3mdLTcsv/AUQ6OBlpU/5ylUb2QHnl+xczaSnOQ5CsCRlrpfDHR6/NwuXRM eBtmXDrlySbjpsoGjje3o6i9AW1XP/wE4G2mzpow0xfvPC0sbiZ2bBUjoDuR+/72Gd1Um+ a7qJnEu8S08KqegPGCp2G3dt+d7aTSGuFo2s575eZLtsSZybPw3eQ4Sg5j9ypah9GaHzy0 vOIEwL8yOCFWzkBA8IRpJOVKw6Iy6MXcnAZVDmF4wGrdoaOIJh6CH1TLO4U4nJsVfqDP6Y 6I0mjRLiCjM1oAIct6MtXKQzg53q+KdJxag6yTnyK/p4TrN2YUPXDKh9n3miUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SLtD21xkXzh6b; Thu, 2 Nov 2023 18:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A2IlkXT044762; Thu, 2 Nov 2023 18:47:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A2IlkTr044759; Thu, 2 Nov 2023 18:47:46 GMT (envelope-from git) Date: Thu, 2 Nov 2023 18:47:46 GMT Message-Id: <202311021847.3A2IlkTr044759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 0b8372b707a5 - main - riscv: Port improvements from arm64/amd64 pmaps, part 3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b8372b707a50c2deeaf66d4c55fec51007cec44 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0b8372b707a50c2deeaf66d4c55fec51007cec44 commit 0b8372b707a50c2deeaf66d4c55fec51007cec44 Author: Mark Johnston AuthorDate: 2023-11-02 18:34:07 +0000 Commit: Mark Johnston CommitDate: 2023-11-02 18:34:07 +0000 riscv: Port improvements from arm64/amd64 pmaps, part 3 - Let pmap_enter_quick_locked() trigger superpage promotions. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D42290 --- sys/riscv/riscv/pmap.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 9b2866d7dd4d..ebb0f069b4ab 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -3405,6 +3405,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, ("pmap_enter_quick_locked: managed mapping within the clean submap")); rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); + l2 = NULL; CTR2(KTR_PMAP, "pmap_enter_quick_locked: %p %lx", pmap, va); /* @@ -3503,6 +3504,26 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, pmap_store(l3, newl3); +#if VM_NRESERVLEVEL > 0 + /* + * If both the PTP and the reservation are fully populated, then attempt + * promotion. + */ + if ((mpte == NULL || mpte->ref_count == Ln_ENTRIES) && + (m->flags & PG_FICTITIOUS) == 0 && + vm_reserv_level_iffullpop(m) == 0) { + if (l2 == NULL) + l2 = pmap_l2(pmap, va); + + /* + * If promotion succeeds, then the next call to this function + * should not be given the unmapped PTP as a hint. + */ + if (pmap_promote_l2(pmap, l2, va, mpte, lockp)) + mpte = NULL; + } +#endif + pmap_invalidate_page(pmap, va); return (mpte); }