* 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
| 1418 | * other considerations. |
| 1419 | */ |
| 1420 | static bool |
| 1421 | cache_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); |
| 1432 | out_evict: |
| 1433 | return (cache_neg_evict()); |
| 1434 | } |
| 1435 | |
| 1436 | /* |
| 1437 | * cache_zap_locked(): |
no test coverage detected