From nobody Thu Oct 10 16:08:48 2024 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 4XPZSJ24KLz5ZF0X; Thu, 10 Oct 2024 16:08:48 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPZSJ1Yjpz4y7w; Thu, 10 Oct 2024 16:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728576528; 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=3r9qAjkBplkQlFTwOi2JZ7u8t0LEiXYlwfZ78fJ9c4A=; b=vKdXag2jbf5CrYKhScg1fkbD7LK7qDRaI4ocF3cJq89O8LzoYvidAw/Q8v87ULGM71BQiI 3c0wk6sHgLvE+chXClwkuD8ihg+c0xfeG7Ar6o+Y6ll7AR6fuVzPjZ3usfegxxSPRepmDS DthFcathbnBwr25fMAaZpP7FWyTcZzsuRMZdzqiGcNUJ6raSwgWG6zIyXW2uVZei0xwuIu LaJ7dPxj1+e7YayD47cK5HMovUt3b2BSRhRQm6VyoNATByL4l7AYvGSYQVLll+8LsvyxZA ViZ3KD89js/GfRRIhA6nMtqJwEN8iOfhZI7f+i/aiUHFomy6rhEbBzMGH/HJ6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728576528; 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=3r9qAjkBplkQlFTwOi2JZ7u8t0LEiXYlwfZ78fJ9c4A=; b=nMh0yzP/tYuSSi84Tw5BaafLJSzc7v74AfaBKA8bXlB2bVH355BIJGv2LlL9Jzc6if8s0g 7SS9SEoZOJkuu8k/9ZkdkOzfIpZdTLsatHTj98lPPyF8LaMUkwNyvZyzgP+1pXdnOLhQtS n3v7NGOPA8ChWcnUvUcNZZMt78Aj+D2yAUMZtCud8PStroRq8Vxe9YcF/H0rYcZBwOsm2w GhdowxrVQS+Qqb0MTTQarX3z2/09yEvR+MZh37xFUrVNaB/VwPCW16hCn1e1qUgT2g5frD C8Z9n37ReYlxdvfRhshp5mV2t4rBoKLi4nkuPhCcfOpH/Tgv0M4UYPLnRyeyjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728576528; a=rsa-sha256; cv=none; b=UE2c6rLZf6iWwlhjXyZBZ6YC6Qu5zSbtUdju58KFeLHELbZkCsstGRgHy87LTtVQwgA2Xm 3iaoOpmaa4QW07vyCZfE0QYqAc2W4yevzJpmnOBdoUFD1Ot3V4vFpdzrbpgRIPhvY1NZUA Qr9EefkCJApnIaXgDWbUcNiyI43SMavShqwtaIabBpRqVYtkvU034z4c91t1EWGu93XP/4 6z0u1Y17SbbPCTU81zFty8hPXTfztaTBaT0yjuhhotZthoW4n9a/VQ4QgoQ8NJbhNYQIvN cllP1KelGpGzph6UCwMM2vA1IvlgqP13X2gMVpGinnxLDTqSPTBhdVNZp1MH+w== 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 4XPZSJ131Vz147Z; Thu, 10 Oct 2024 16:08:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AG8muK064439; Thu, 10 Oct 2024 16:08:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AG8m6Q064436; Thu, 10 Oct 2024 16:08:48 GMT (envelope-from git) Date: Thu, 10 Oct 2024 16:08:48 GMT Message-Id: <202410101608.49AG8m6Q064436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: c71c41da618a - main - vm_radix: add iter insert and remove interfaces 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c71c41da618a468349e5b32b77d627718264f97e Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=c71c41da618a468349e5b32b77d627718264f97e commit c71c41da618a468349e5b32b77d627718264f97e Author: Doug Moore AuthorDate: 2024-10-10 16:07:40 +0000 Commit: Doug Moore CommitDate: 2024-10-10 16:07:40 +0000 vm_radix: add iter insert and remove interfaces Add functions in the vm_radix style for using iterators to insert or remove a page from a radix tree. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D47021 --- sys/vm/vm_radix.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_radix.h b/sys/vm/vm_radix.h index d35c9a171d4b..e1f7323dd205 100644 --- a/sys/vm/vm_radix.h +++ b/sys/vm/vm_radix.h @@ -60,7 +60,7 @@ PCTRIE_DEFINE_SMR(VM_RADIX, vm_page, pindex, vm_radix_node_alloc, vm_radix_node_free, vm_radix_smr); /* - * Inserts the key-value pair into the trie. + * Inserts the key-value pair into the trie, starting search from root. * Panics if the key already exists. */ static __inline int @@ -69,6 +69,16 @@ vm_radix_insert(struct vm_radix *rtree, vm_page_t page) return (VM_RADIX_PCTRIE_INSERT(&rtree->rt_trie, page)); } +/* + * Inserts the key-value pair into the trie, starting search from iterator. + * Panics if the key already exists. + */ +static __inline int +vm_radix_iter_insert(struct pctrie_iter *pages, vm_page_t page) +{ + return (VM_RADIX_PCTRIE_ITER_INSERT(pages, page)); +} + /* * Insert the page into the vm_radix tree with its pindex as the key. Panic if * the pindex already exists. Return zero on success or a non-zero error on @@ -187,6 +197,15 @@ vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index) { return (VM_RADIX_PCTRIE_REMOVE_LOOKUP(&rtree->rt_trie, index)); } + +/* + * Remove the current page from the trie. + */ +static __inline void +vm_radix_iter_remove(struct pctrie_iter *pages) +{ + VM_RADIX_PCTRIE_ITER_REMOVE(pages); +} /* * Reclaim all the interior nodes of the trie, and invoke the callback