From nobody Thu Jun 13 18:52:47 2024 X-Original-To: dev-commits-src-all@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 4W0WkS0V5Nz5P9Ch; Thu, 13 Jun 2024 18:52: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W0WkS004wz4n2L; Thu, 13 Jun 2024 18:52:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718304768; 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=eioNDVLCcJ6QLuoriRY+xUbid493fojn0JBFKEnjqdk=; b=j+ld5/nKW8+XnsfIz/RvIrcVrcugqM+VO4De5wVEiu41PGh845iKes9C+ZLDL3txlzoKUl IyKKy2WDemzWZgU4hnkS+XNknfZw/D10e7grEFOiHgV/XiTsQ9D+ByW3Kv+xW9QgX7SWxn iT1XXsTJkDWOKBglfV3E47dpxlOeC0PwJmuZZv9kM6SIN5P+1PTxLPdpFLlCkY8JGS8gBQ 1XwOtahQSagmRPyQHM8ea9htPoOFuYdUQ461jH28pSBhHGjdDYj1iXzEy8IyAE14bx3x6U sdsU1xSpCoHHxuGAYXeNnadIDJRAXLRbg8CD9+l9A+79Wl0i71patUVwR0LD0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718304768; a=rsa-sha256; cv=none; b=n8Nj3ZYfdV1rAMfPM5xGJk3lDVqPXeW+wqjEIr64WTLHBuARaRB1eJB7mory3pvYhGJ1Hx xe5eWsirCiUx4Oyh3dnALAYUfHRd5dlkBx8/A85ZqdsORt3SZsMlQraeXIxhUXteDXTgiU yWUtbzTezibJ+mFEGWzStRQtEHxdSFRJvZGDoVYLQVgy1UncZZAv7+nOvUZjM7U2YXOkdS 3AOx21/cP4n/ZyXqRrRhQaolpyTI/U5Ln17D5BPxo47NnTyvI10ho+HDglgthnXicL0dOM QUx/REhaGRbEoAYIwtDjXx0ss9tcF5avC3VxSWpGI7P33DDexlIgLw9q3cZVoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718304768; 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=eioNDVLCcJ6QLuoriRY+xUbid493fojn0JBFKEnjqdk=; b=OPhFL2+woN+HeJmlB3IotYCQ1kRULk3B35lLs4ydJrUr6NycWAMFEcfw2nCGKZi5afqIom JtiiFOin6lk2FYGcaTCryPuSk3VISs0Hx0kpm7TZtEZVPKf0oSW/F8/Iu+X+0v0w+qMoIg o6hGx9RwMVIcZWUQCQCOfedJfp5B+kcj9LXwFq/5XLrna79uVEHM/nVpIT7ZvMOiBkWKQ6 UC7J41oG1VjbpVaPJMLdX/+TdozTusv++UzLoSkRwZlxJmf9pAMEeGKgSrAozGhm42JF1g pyK1+l+MN18s9ccijcLOf7slKbWDpbIvMhIdzuz/gIImMPw55Yd+rFXdBW/DEg== 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 4W0WkR6jHczpMl; Thu, 13 Jun 2024 18:52:47 +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 45DIqlNf004454; Thu, 13 Jun 2024 18:52:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45DIqlnB004450; Thu, 13 Jun 2024 18:52:47 GMT (envelope-from git) Date: Thu, 13 Jun 2024 18:52:47 GMT Message-Id: <202406131852.45DIqlnB004450@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: d2acf0a44709 - main - swap_pager: pctrie_reclaim_cb in meta_free_all List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: d2acf0a447093dcf0805c75490e1cd989bc8c36c Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=d2acf0a447093dcf0805c75490e1cd989bc8c36c commit d2acf0a447093dcf0805c75490e1cd989bc8c36c Author: Doug Moore AuthorDate: 2024-06-13 18:47:54 +0000 Commit: Doug Moore CommitDate: 2024-06-13 18:52:25 +0000 swap_pager: pctrie_reclaim_cb in meta_free_all Replace the lookup-remove loop in swp_pager_meta_free_all with a call to SWAP_PCTRIE_RECLAIM_CALLBACK, to eliminate repeated trie searches. Reviewed by: rlibby Differential Revision: https://reviews.freebsd.org/D45583 --- sys/vm/swap_pager.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 3bfda3eea169..c339f70ddea1 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2220,8 +2220,11 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count, } static void -swp_pager_meta_free_block(struct swblk *sb, struct page_range *range) +swp_pager_meta_free_block(void *sbv, void *rangev) { + struct swblk *sb = sbv; + struct page_range *range = rangev; + for (int i = 0; i < SWAP_META_PAGES; i++) { if (sb->d[i] != SWAPBLK_NONE) swp_pager_update_freerange(range, sb->d[i]); @@ -2238,19 +2241,13 @@ swp_pager_meta_free_block(struct swblk *sb, struct page_range *range) static void swp_pager_meta_free_all(vm_object_t object) { - struct swblk *sb; struct page_range range; - vm_pindex_t pindex; VM_OBJECT_ASSERT_WLOCKED(object); swp_pager_init_freerange(&range); - for (pindex = 0; (sb = SWAP_PCTRIE_LOOKUP_GE( - &object->un_pager.swp.swp_blks, pindex)) != NULL;) { - pindex = sb->p + SWAP_META_PAGES; - SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, sb->p); - swp_pager_meta_free_block(sb, &range); - } + SWAP_PCTRIE_RECLAIM_CALLBACK(&object->un_pager.swp.swp_blks, + swp_pager_meta_free_block, &range); swp_pager_freeswapspace(&range); }