All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: linux-nfs@vger.kernel.org, netdev@vger.kernel.org
Cc: david@fromorbit.com, jlayton@redhat.com, tgraf@suug.ch
Subject: [PATCH v2 08/31] NFSD: Refactor nfsd_file_lru_scan()
Date: Tue, 28 Jun 2022 14:06:37 -0400	[thread overview]
Message-ID: <165643959792.84360.10284953152240793323.stgit@manet.1015granger.net> (raw)
In-Reply-To: <165643915086.84360.2809940286726976517.stgit@manet.1015granger.net>

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 fs/nfsd/filecache.c |   25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index 4e1162f51a70..79cbbbdf8355 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -478,23 +478,6 @@ static void nfsd_file_gc_dispose_list(struct list_head *dispose)
 	nfsd_file_dispose_list_delayed(dispose);
 }
 
-static unsigned long
-nfsd_file_lru_walk_list(struct shrink_control *sc)
-{
-	LIST_HEAD(head);
-	unsigned long ret;
-
-	if (sc)
-		ret = list_lru_shrink_walk(&nfsd_file_lru, sc,
-				nfsd_file_lru_cb, &head);
-	else
-		ret = list_lru_walk(&nfsd_file_lru,
-				nfsd_file_lru_cb,
-				&head, LONG_MAX);
-	nfsd_file_gc_dispose_list(&head);
-	return ret;
-}
-
 static void
 nfsd_file_gc(void)
 {
@@ -521,7 +504,13 @@ nfsd_file_lru_count(struct shrinker *s, struct shrink_control *sc)
 static unsigned long
 nfsd_file_lru_scan(struct shrinker *s, struct shrink_control *sc)
 {
-	return nfsd_file_lru_walk_list(sc);
+	LIST_HEAD(dispose);
+	unsigned long ret;
+
+	ret = list_lru_shrink_walk(&nfsd_file_lru, sc,
+				   nfsd_file_lru_cb, &dispose);
+	nfsd_file_gc_dispose_list(&dispose);
+	return ret;
 }
 
 static struct shrinker	nfsd_file_shrinker = {



  parent reply	other threads:[~2022-06-28 18:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 18:05 [PATCH v2 00/31] Overhaul NFSD filecache Chuck Lever
2022-06-28 18:05 ` [PATCH v2 01/31] NFSD: Demote a WARN to a pr_warn() Chuck Lever
2022-06-28 18:05 ` [PATCH v2 02/31] NFSD: Report filecache LRU size Chuck Lever
2022-06-28 18:06 ` [PATCH v2 03/31] NFSD: Report count of calls to nfsd_file_acquire() Chuck Lever
2022-06-28 18:06 ` [PATCH v2 04/31] NFSD: Report count of freed filecache items Chuck Lever
2022-06-28 18:06 ` [PATCH v2 05/31] NFSD: Report average age of " Chuck Lever
2022-06-28 18:06 ` [PATCH v2 06/31] NFSD: Add nfsd_file_lru_dispose_list() helper Chuck Lever
2022-06-28 18:06 ` [PATCH v2 07/31] NFSD: Refactor nfsd_file_gc() Chuck Lever
2022-06-28 18:06 ` Chuck Lever [this message]
2022-06-28 18:06 ` [PATCH v2 09/31] NFSD: Report the number of items evicted by the LRU walk Chuck Lever
2022-06-28 18:06 ` [PATCH v2 10/31] NFSD: Record number of flush calls Chuck Lever
2022-06-28 18:06 ` [PATCH v2 11/31] NFSD: Zero counters when the filecache is re-initialized Chuck Lever
2022-06-28 18:07 ` [PATCH v2 12/31] NFSD: Hook up the filecache stat file Chuck Lever
2022-06-28 18:07 ` [PATCH v2 13/31] NFSD: WARN when freeing an item still linked via nf_lru Chuck Lever
2022-06-28 18:07 ` [PATCH v2 14/31] NFSD: Trace filecache LRU activity Chuck Lever
2022-06-28 18:07 ` [PATCH v2 15/31] NFSD: Leave open files out of the filecache LRU Chuck Lever
2022-06-28 18:07 ` [PATCH v2 16/31] NFSD: Fix the filecache LRU shrinker Chuck Lever
2022-06-28 18:07 ` [PATCH v2 17/31] NFSD: Never call nfsd_file_gc() in foreground paths Chuck Lever
2022-06-28 18:07 ` [PATCH v2 18/31] NFSD: No longer record nf_hashval in the trace log Chuck Lever
2022-06-28 18:07 ` [PATCH v2 19/31] NFSD: Remove lockdep assertion from unhash_and_release_locked() Chuck Lever
2022-06-28 18:07 ` [PATCH v2 20/31] NFSD: nfsd_file_unhash can compute hashval from nf->nf_inode Chuck Lever
2022-06-28 18:08 ` [PATCH v2 21/31] NFSD: Refactor __nfsd_file_close_inode() Chuck Lever
2022-06-28 18:08 ` [PATCH v2 22/31] NFSD: nfsd_file_hash_remove can compute hashval Chuck Lever
2022-06-28 18:08 ` [PATCH v2 23/31] NFSD: Remove nfsd_file::nf_hashval Chuck Lever
2022-06-28 18:08 ` [PATCH v2 24/31] NFSD: Replace the "init once" mechanism Chuck Lever
2022-06-28 18:08 ` [PATCH v2 25/31] NFSD: Set up an rhashtable for the filecache Chuck Lever
2022-06-28 18:08 ` [PATCH v2 26/31] NFSD: Convert the filecache to use rhashtable Chuck Lever
2022-06-28 18:08 ` [PATCH v2 27/31] NFSD: Clean up unused code after rhashtable conversion Chuck Lever
2022-06-28 18:08 ` [PATCH v2 28/31] NFSD: Separate tracepoints for acquire and create Chuck Lever
2022-06-28 18:08 ` [PATCH v2 29/31] NFSD: Move nfsd_file_trace_alloc() tracepoint Chuck Lever
2022-06-28 18:09 ` [PATCH v2 30/31] NFSD: Update the nfsd_file_fsnotify_handle_event() tracepoint Chuck Lever
2022-06-28 18:09 ` [PATCH v2 31/31] NFSD: NFSv4 CLOSE should release an nfsd_file immediately Chuck Lever

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=165643959792.84360.10284953152240793323.stgit@manet.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=david@fromorbit.com \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.