Whamcloud - gitweb
LU-6365 obd: Eliminate hash bucket scans in lu_cache_shrink 66/14066/3
authorAnn Koehler <amk@cray.com>
Tue, 14 Jul 2015 21:52:26 +0000 (16:52 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 9 Aug 2015 23:39:18 +0000 (23:39 +0000)
commitfc2f0c39d8bed5060774e3b4cca7bf13faa3692a
treec8b81019204d779c4d9fc0ccc75aac63412ddb48
parent22dfd6e96b4483617a62442ffda560f4e5819181
LU-6365 obd: Eliminate hash bucket scans in lu_cache_shrink

The lu_cache_shrink slab shrinker is too slow, accounting for > 90% of
the time spent in shrink_slab when allocating huge pages. Most of its
time is spent iterating over the buckets in each site's object hash
table to compute the number of freeable objects. This iteration is
eliminated by adding an lru length count to the lu_site struct. A
percpu counter is used to maintain the lru length, so that the
lu_site does not need to be locked when an object is accessed through
the hash table. A counter is updated whenever an object is added to
or deleted from any of the hash table buckets. The number of freeable
objects is the sum of the counter values across all cpus.

Signed-off-by: Ann Koehler <amk@cray.com>
Change-Id: I5c70dd8e8cc1fe024292076e118774d9299bf40b
Reviewed-on: http://review.whamcloud.com/14066
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lu_object.h
lustre/obdclass/lu_object.c