Skip to content

Commit 1601e2f

Browse files
committed
NFSD: Re-organize nfsd_file_gc_worker()
Dave opines: IMO, there is no need to do this unnecessary work on every object that is added to the LRU. Changing the gc worker to always run every 2s and check if it has work to do like so: static void nfsd_file_gc_worker(struct work_struct *work) { - nfsd_file_gc(); - if (list_lru_count(&nfsd_file_lru)) - nfsd_file_schedule_laundrette(); + if (list_lru_count(&nfsd_file_lru)) + nfsd_file_gc(); + nfsd_file_schedule_laundrette(); } means that nfsd_file_gc() will be run the same way and have the same behaviour as the current code. When the system it idle, it does a list_lru_count() check every 2 seconds and goes back to sleep. That's going to be pretty much unnoticable on most machines that run NFS servers. Suggested-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent f77ce2e commit 1601e2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/nfsd/filecache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,9 @@ nfsd_file_gc(void)
549549
static void
550550
nfsd_file_gc_worker(struct work_struct *work)
551551
{
552-
nfsd_file_gc();
553552
if (list_lru_count(&nfsd_file_lru))
554-
nfsd_file_schedule_laundrette();
553+
nfsd_file_gc();
554+
nfsd_file_schedule_laundrette();
555555
}
556556

557557
static unsigned long

0 commit comments

Comments
 (0)