avoid downward vcache pressure when entries are free

we try to keep VCACHE_FREE entries free. if there's already that many free,
do nothing.

Change-Id: I7e92430329a17250f94d0435de7641fa331dd461
Reviewed-on: http://gerrit.openafs.org/4595
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Derrick Brashear 2011-04-29 03:59:19 -04:00
parent 76158df491
commit fd545c51fe

View File

@ -235,15 +235,13 @@ afs_Daemon(void)
if (afsd_dynamic_vcaches && (last5MinCheck + 300 < now)) { if (afsd_dynamic_vcaches && (last5MinCheck + 300 < now)) {
/* start with trying to drop us back to our base usage */ /* start with trying to drop us back to our base usage */
int anumber; int anumber = VCACHE_FREE + (afs_vcount - afs_cacheStats);
if (afs_vcount <= afs_cacheStats)
anumber = VCACHE_FREE;
else
anumber = VCACHE_FREE + (afs_vcount - afs_cacheStats);
if (anumber > 0) {
ObtainWriteLock(&afs_xvcache, 734); ObtainWriteLock(&afs_xvcache, 734);
afs_ShakeLooseVCaches(anumber); afs_ShakeLooseVCaches(anumber);
ReleaseWriteLock(&afs_xvcache); ReleaseWriteLock(&afs_xvcache);
}
last5MinCheck = now; last5MinCheck = now;
} }