Whamcloud - gitweb
LU-3641 libcfs: Zero fill shrinker struct in cfs_set_shrinker
authorAnn Koehler <amk@cray.com>
Thu, 25 Jul 2013 21:07:57 +0000 (16:07 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 8 Aug 2013 06:09:20 +0000 (02:09 -0400)
commitb358baadbbad0262c459126cffb4e6761eceab32
tree392ff56d21beb791298eb86d8fe7e967c1a31bf4
parent24429b8219351b2ea32435a8b683161db53fd123
LU-3641 libcfs: Zero fill shrinker struct in cfs_set_shrinker

Dropping Lustre caches might not terminate if the Linux kernel
supports the customisable shrinker batch size feature (commit
e9299f5058595a655c3b207cda9635e28b9197e6). This kernel feature
added a new field (batch) to the shrinker struct. Lustre does
not initialize it. When the unitialized batch value is negative,
the kernel shrink_slab function never terminates its loop that
calls the Lustre shrinker function. The problem was observed
with the ldlm_pools_cli_shrink shrinker, but it could also happen
with other Lustre shrinkers.

The fix is to ensure that all fields of the shrinker struct are
initialized by zero filling the struct when cfs_set_shrinker
allocates it. Zero filling works with all versions of the kernel.

Signed-off-by: Ann Koehler <amk@cray.com>
Change-Id: I3efa3a858f5d367f73596f38bb4e40b51c2ac5e7
Reviewed-on: http://review.whamcloud.com/7122
Reviewed-by: Patrick Farrell <paf@cray.com>
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
libcfs/include/libcfs/linux/linux-mem.h