Go to file
Michael Meffie 5c136c7d93 afs: shake harder in shake-loose-vcaches
Linux based cache managers will allocate vcaches on demand and
deallocate batches of vcaches in the background. This feature is called
dynamic vcaches.

Vcaches to be deallocated are found by traversing the vcache LRU list
(VLRU) from the oldest vcache to the newest. Up to a target number of
vcaches are attempted to be evicted.  The afs_xvcache lock protecting
the VLRU may be dropped and re-acquired while attempting to evict a
vcache. When this happens, it is possible the VLRU may have changed, so
the traversal of the VLRU is restarted.  This restarting of the VLRU
transversal is limited to 100 iterations to avoid looping indefinitely.

Vcaches which are busy cannot be evicted and remain in the VLRU. When a
busy cache was not evicted and the afs_xvache lock was dropped, the VLRU
traversal is restarted from the end of the VLRU. When the busy vcache is
encountered on the retry, it will trigger additional retries until the
loop limit is reached, at which point the target number of vcaches will
not be deallocated.

This can leave a very large number of unbusy vcaches which are never
deallocated.  On a busy machine, tens of millions of unused vcaches can
remain in memory. When the busy vcache at the end of the VLRU is finally
evicted, the log jam is broken, and the background deamon will hold the
afs_xvcache lock for an excessively long time, hanging the system.

Fix this by moving busy vcaches to the head of the VLRU before
restarting the VLRU traversal. These busy vcaches will be skipped when
retrying the VLRU traversal, allowing the cache manager to make progress
deallocating vcaches down to the target level.

This was already done on the mac osx platform while attempting to evict
vcaches. Move the code to move busy vcaches to the head of the VLRU up
the the platform agnostic caller.

Thanks to Andrew Deason for the initial version of this patch.

Change-Id: I7768d00604e56d8d5369ac5215f7c2ab7996c4eb
Reviewed-on: https://gerrit.openafs.org/11654
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2016-04-12 22:16:59 -04:00
build-tools fix src tarball error text in make-release 2013-09-07 07:40:44 -07:00
doc doc: add missing angle bracket 2016-03-28 21:07:56 -04:00
src afs: shake harder in shake-loose-vcaches 2016-04-12 22:16:59 -04:00
tests test: skip buserror test when SIGBUS is not defined in perl POSIX module 2016-02-10 23:47:52 -05:00
.gitignore Add libtool support 2012-09-04 06:55:51 -07:00
.splintrc start-splint-support-20030528 2003-05-28 19:18:08 +00:00
acinclude.m4 Linux 4.4: Do not use splice() 2016-03-21 13:33:08 -04:00
CODING rxkad: Resolve warnings in ticket5.c 2015-12-25 01:57:06 -05:00
configure-libafs.ac build-sys: use m4 quoting consistantly 2013-07-12 08:04:23 -07:00
configure.ac IRIX: Move src/sgistuff to platform/IRIX 2015-01-22 09:42:00 -05:00
CONTRIBUTING openafs: add a contributor code of conduct 2015-09-18 20:38:28 -04:00
INSTALL readme: remove README.PTHREADED_UBIK 2015-08-17 22:17:25 -04:00
libafsdep Move build support files into build-tools 2010-07-14 20:40:36 -07:00
LICENSE readme: move the LICENSE file to the top level directory 2015-08-17 22:10:05 -04:00
Makefile-libafs.in Fix libafs_tree's cross-architecture support 2010-05-24 20:28:41 -07:00
Makefile.in readme: move the LICENSE file to the top level directory 2015-08-17 22:10:05 -04:00
NEWS Update NEWS for 1.6.2.1 2013-03-25 11:45:46 -07:00
NTMakefile build: remove trailing whitespace from makefiles 2014-10-08 10:46:57 -04:00
README Tweak grammar in README 2015-12-28 19:32:17 -05:00
README-WINDOWS Update windows build documentation 2013-07-02 15:14:09 -07:00
regen.sh regen: look for glibtoolize also 2012-09-06 12:04:22 -07:00

AFS is a distributed file system that enables users to share and
access all of the files stored in a network of computers as easily as
they access the files stored on their local machines. The file system is
called distributed for this exact reason: files can reside on many
different machines, but are available to users on every machine.

OpenAFS 1.0 was originally released by IBM under the terms of the
IBM Public License 1.0 (IPL10).  For details on IPL10 see the LICENSE
file in this directory.  The current OpenAFS distribution is licensed
under a combination of the IPL10 and many other licenses as granted by
the relevant copyright holders.  The LICENSE file in this directory
contains more details, thought it is not a comprehensive statement.

See INSTALL for information about building and installing OpenAFS
on various platforms.

See CODING for developer information and guidelines.

See NEWS for recent changes to OpenAFS.