afs: Fix some dcache-related comments

- The comments preceding the afs_CacheIsTooFull macro, describing the
   cache-related high and low water marks, are a little out of date.
   We start freeing on 90% space, not 95%, and we also can take into
   account how many free/used chunks we have.

 - afs_WakeCacheWaitersIfDrained looks at the number of non-used (free
   or discarded) blocks, not just free blocks.

Change-Id: I5bf923b3c24993294e752f4312737815d0102779
Reviewed-on: http://gerrit.openafs.org/10459
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Andrew Deason 2013-11-14 12:06:56 -06:00 committed by Derrick Brashear
parent cef726558d
commit 81b7857741
2 changed files with 10 additions and 4 deletions

View File

@ -1392,9 +1392,14 @@ extern struct brequest afs_brs[NBRS]; /* request structures */
(((rw) == UIO_WRITE) ? afs_write(avc, uio, io, cred, 1) : afs_read(avc, uio, cred, 1)) (((rw) == UIO_WRITE) ? afs_write(avc, uio, io, cred, 1) : afs_read(avc, uio, cred, 1))
/* Cache size truncation uses the following low and high water marks: /* Cache size truncation uses the following low and high water marks:
* If the cache is more than 95% full (CM_DCACHECOUNTFREEPCT), the cache * If the cache is more than 90% full by space (CM_DCACHESPACEFREEPCT) or
* truncation daemon is awakened and will free up space until the cache is 85% * 95% full by # of chunks (CM_DCACHECOUNTFREEPCT), the cache truncation
* (CM_DCACHESPACEFREEPCT - CM_DCACHEEXTRAPCT) full. * daemon is awakened and will start freeing space. The cache truncation
* daemon will continue to free space until the cache is at most 85% full
* by space (CM_DCACHESPACEFREEPCT - CM_DCACHEEXTRAPCT). The cache truncation
* daemon will also try to free space until the cache is at most 90% full by
* chunks (CM_DCACHECOUNTFREEPCT - CM_DCACHEEXTRAPCT), but the 85% space limit
* is the only limit that we must hit.
* afs_UFSWrite and afs_GetDCache (when it needs to fetch data) will wait on * afs_UFSWrite and afs_GetDCache (when it needs to fetch data) will wait on
* afs_WaitForCacheDrain if the cache is 98% (CM_WAITFORDRAINPCT) full. * afs_WaitForCacheDrain if the cache is 98% (CM_WAITFORDRAINPCT) full.
* afs_GetDownD wakes those processes once the cache is 95% full * afs_GetDownD wakes those processes once the cache is 95% full

View File

@ -397,7 +397,8 @@ u_int afs_min_cache = 0;
/*! /*!
* If there are waiters for the cache to drain, wake them if * If there are waiters for the cache to drain, wake them if
* the number of free cache blocks reaches the CM_CACHESIZEDDRAINEDPCT. * the number of free or discarded cache blocks reaches the
* CM_CACHESIZEDDRAINEDPCT limit.
* *
* \note Environment: * \note Environment:
* This routine must be called with the afs_xdcache lock held * This routine must be called with the afs_xdcache lock held