From: Chuck Lever <chuck.lever@oracle.com>
To: NeilBrown <neilb@suse.de>, Jeff Layton <jlayton@kernel.org>
Cc: linux-nfs@vger.kernel.org,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH 3/6] nfsd: filecache: use list_lru_walk_node() in nfsd_file_gc()
Date: Fri, 7 Feb 2025 09:43:17 -0500 [thread overview]
Message-ID: <fb5deaea-0ffe-4f66-9757-7c38934b4c29@oracle.com> (raw)
In-Reply-To: <20250207051701.3467505-4-neilb@suse.de>
On 2/7/25 12:15 AM, NeilBrown wrote:
> list_lru_walk() is only useful when the aim is to remove all elements
> from the list_lru.
I think I get where this is going. Can the description cite some API
documentation that comports with this claim?
> It will repeated visit rotated element of the first
> per-node sublist before proceeding to subsrequent sublists.
s/repeated/repeatedly, s/element/elements, and s/subsrequent/subsequent.
> This patch changes to use list_lru_walk_node() and list_lru_count_node()
> on each individual node.
>
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
> fs/nfsd/filecache.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
> index 7dc20143c854..04588c03bdfe 100644
> --- a/fs/nfsd/filecache.c
> +++ b/fs/nfsd/filecache.c
> @@ -532,10 +532,14 @@ static void
> nfsd_file_gc(void)
> {
> LIST_HEAD(dispose);
> - unsigned long ret;
> + unsigned long ret = 0;
> + int nid;
>
> - ret = list_lru_walk(&nfsd_file_lru, nfsd_file_lru_cb,
> - &dispose, list_lru_count(&nfsd_file_lru));
> + for_each_node_state(nid, N_NORMAL_MEMORY) {
> + unsigned long nr = list_lru_count_node(&nfsd_file_lru, nid);
> + ret += list_lru_walk_node(&nfsd_file_lru, nid, nfsd_file_lru_cb,
> + &dispose, &nr);
> + }
> trace_nfsd_file_gc_removed(ret, list_lru_count(&nfsd_file_lru));
Nit: Maybe this trace point should be placed in the loop and changed to
record the nid as well?
> nfsd_file_dispose_list_delayed(&dispose);
Wondering if maybe the nfsd_file_dispose_list_delayed() call should also
be moved inside the for loop to break up the disposal processing per
node as well.
> }
--
Chuck Lever
next prev parent reply other threads:[~2025-02-07 14:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 5:15 [PATCH 0/6] nfsd: filecache: various fixes NeilBrown
2025-02-07 5:15 ` [PATCH 1/6] nfsd: filecache: remove race handling NeilBrown
2025-02-10 23:33 ` Dave Chinner
2025-02-12 22:16 ` NeilBrown
2025-02-13 15:02 ` Chuck Lever
2025-02-07 5:15 ` [PATCH 2/6] nfsd: filecache: use nfsd_file_dispose_list() in nfsd_file_close_inode_sync() NeilBrown
2025-02-07 5:15 ` [PATCH 3/6] nfsd: filecache: use list_lru_walk_node() in nfsd_file_gc() NeilBrown
2025-02-07 14:43 ` Chuck Lever [this message]
2025-02-09 23:16 ` NeilBrown
2025-02-10 13:46 ` Jeff Layton
2025-02-07 5:15 ` [PATCH 4/6] nfsd: filecache: introduce NFSD_FILE_RECENT NeilBrown
2025-02-07 14:52 ` Chuck Lever
2025-02-09 23:23 ` NeilBrown
2025-02-10 0:50 ` Chuck Lever
2025-02-10 2:31 ` NeilBrown
2025-02-10 14:25 ` Jeff Layton
2025-02-12 22:39 ` NeilBrown
2025-02-13 0:08 ` Chuck Lever
2025-02-13 11:27 ` Jeff Layton
2025-02-10 14:26 ` Chuck Lever
2025-02-10 14:01 ` Jeff Layton
2025-02-10 23:57 ` Dave Chinner
2025-02-11 11:38 ` Jeff Layton
2025-02-07 5:15 ` [PATCH 5/6] nfsd: filecache: don't repeatedly add/remove files on the lru list NeilBrown
2025-02-07 5:15 ` [PATCH 6/6] nfsd: filecache: drop the list_lru lock during lock gc scans NeilBrown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fb5deaea-0ffe-4f66-9757-7c38934b4c29@oracle.com \
--to=chuck.lever@oracle.com \
--cc=Dai.Ngo@oracle.com \
--cc=david@fromorbit.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox