Skip to content

Commit fb340bf

Browse files
committed
NFSD: Delay adding new entries to LRU
Neil Brown observes: > I would not include RC_INPROG entries in the lru at all - they are > always ignored, and will be added when they are switched to > RCU_DONE. I also removed a stale comment. Suggested-by: NeilBrown <[email protected]> Reviewed-by: NeilBrown <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent d73d06d commit fb340bf

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

fs/nfsd/nfscache.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,6 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
237237

238238
}
239239

240-
/*
241-
* Move cache entry to end of LRU list, and queue the cleaner to run if it's
242-
* not already scheduled.
243-
*/
244240
static void
245241
lru_put_end(struct nfsd_drc_bucket *b, struct nfsd_cacherep *rp)
246242
{
@@ -272,13 +268,6 @@ nfsd_prune_bucket_locked(struct nfsd_net *nn, struct nfsd_drc_bucket *b,
272268

273269
/* The bucket LRU is ordered oldest-first. */
274270
list_for_each_entry_safe(rp, tmp, &b->lru_head, c_lru) {
275-
/*
276-
* Don't free entries attached to calls that are still
277-
* in-progress, but do keep scanning the list.
278-
*/
279-
if (rp->c_state == RC_INPROG)
280-
continue;
281-
282271
if (atomic_read(&nn->num_drc_entries) <= nn->max_drc_entries &&
283272
time_before(expiry, rp->c_timestamp))
284273
break;
@@ -453,8 +442,6 @@ nfsd_cache_insert(struct nfsd_drc_bucket *b, struct nfsd_cacherep *key,
453442
nn->longest_chain_cachesize,
454443
atomic_read(&nn->num_drc_entries));
455444
}
456-
457-
lru_put_end(b, ret);
458445
return ret;
459446
}
460447

0 commit comments

Comments
 (0)