mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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 <neil@brown.name> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
@@ -237,10 +237,6 @@ void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Move cache entry to end of LRU list, and queue the cleaner to run if it's
|
|
||||||
* not already scheduled.
|
|
||||||
*/
|
|
||||||
static void
|
static void
|
||||||
lru_put_end(struct nfsd_drc_bucket *b, struct nfsd_cacherep *rp)
|
lru_put_end(struct nfsd_drc_bucket *b, struct nfsd_cacherep *rp)
|
||||||
{
|
{
|
||||||
@@ -272,13 +268,6 @@ nfsd_prune_bucket_locked(struct nfsd_net *nn, struct nfsd_drc_bucket *b,
|
|||||||
|
|
||||||
/* The bucket LRU is ordered oldest-first. */
|
/* The bucket LRU is ordered oldest-first. */
|
||||||
list_for_each_entry_safe(rp, tmp, &b->lru_head, c_lru) {
|
list_for_each_entry_safe(rp, tmp, &b->lru_head, c_lru) {
|
||||||
/*
|
|
||||||
* Don't free entries attached to calls that are still
|
|
||||||
* in-progress, but do keep scanning the list.
|
|
||||||
*/
|
|
||||||
if (rp->c_state == RC_INPROG)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (atomic_read(&nn->num_drc_entries) <= nn->max_drc_entries &&
|
if (atomic_read(&nn->num_drc_entries) <= nn->max_drc_entries &&
|
||||||
time_before(expiry, rp->c_timestamp))
|
time_before(expiry, rp->c_timestamp))
|
||||||
break;
|
break;
|
||||||
@@ -453,8 +442,6 @@ out:
|
|||||||
nn->longest_chain_cachesize,
|
nn->longest_chain_cachesize,
|
||||||
atomic_read(&nn->num_drc_entries));
|
atomic_read(&nn->num_drc_entries));
|
||||||
}
|
}
|
||||||
|
|
||||||
lru_put_end(b, ret);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user