MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cache_neg_evict_cond

Function cache_neg_evict_cond

freebsd/kern/vfs_cache.c:1420–1434  ·  view source on GitHub ↗

* Maybe evict a negative entry to create more room. * * The ncnegfactor parameter limits what fraction of the total count * can comprise of negative entries. However, if the cache is just * warming up this leads to excessive evictions. As such, ncnegminpct * (recomputed to neg_min) dictates whether the above should be * applied. * * Try evicting if the cache is close to full capacity rega

Source from the content-addressed store, hash-verified

1418 * other considerations.
1419 */
1420static bool
1421cache_neg_evict_cond(u_long lnumcache)
1422{
1423 u_long lnumneg;
1424
1425 if (ncsize - 1000 < lnumcache)
1426 goto out_evict;
1427 lnumneg = atomic_load_long(&numneg);
1428 if (lnumneg < neg_min)
1429 return (false);
1430 if (lnumneg * ncnegfactor < lnumcache)
1431 return (false);
1432out_evict:
1433 return (cache_neg_evict());
1434}
1435
1436/*
1437 * cache_zap_locked():

Callers 1

cache_allocFunction · 0.85

Calls 1

cache_neg_evictFunction · 0.85

Tested by

no test coverage detected