Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nfsd: fix up the filecache laundrette scheduling

We don't really care whether there are hashed entries when it comes to
scheduling the laundrette. They might all be non-gc entries, after all.
We only want to schedule it if there are entries on the LRU.

Switch to using list_lru_count, and move the check into
nfsd_file_gc_worker. The other callsite in nfsd_file_put doesn't need to
count entries, since it only schedules the laundrette after adding an
entry to the LRU.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Jeff Layton and committed by
Chuck Lever
22ae4c11 82141185

+5 -7
+5 -7
fs/nfsd/filecache.c
··· 211 211 static void 212 212 nfsd_file_schedule_laundrette(void) 213 213 { 214 - if ((atomic_read(&nfsd_file_rhash_tbl.nelems) == 0) || 215 - test_bit(NFSD_FILE_CACHE_UP, &nfsd_file_flags) == 0) 216 - return; 217 - 218 - queue_delayed_work(system_wq, &nfsd_filecache_laundrette, 219 - NFSD_LAUNDRETTE_DELAY); 214 + if (test_bit(NFSD_FILE_CACHE_UP, &nfsd_file_flags)) 215 + queue_delayed_work(system_wq, &nfsd_filecache_laundrette, 216 + NFSD_LAUNDRETTE_DELAY); 220 217 } 221 218 222 219 static void ··· 663 666 nfsd_file_gc_worker(struct work_struct *work) 664 667 { 665 668 nfsd_file_gc(); 666 - nfsd_file_schedule_laundrette(); 669 + if (list_lru_count(&nfsd_file_lru)) 670 + nfsd_file_schedule_laundrette(); 667 671 } 668 672 669 673 static unsigned long