Whamcloud - gitweb
LU-5164 osd: Limit lu_object cache 01/12001/3
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 20 Sep 2014 06:43:56 +0000 (23:43 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 11 Oct 2014 04:40:55 +0000 (04:40 +0000)
commita56aef9a3538300b027d5a2591cb9036a85a2c14
treed2e7beebfe75088da07e43d088b9687a7e171830
parent1651435b8749219b85b8d3640f8e4453d7e8463d
LU-5164 osd: Limit lu_object cache

For OSDs like ZFS to perform optimally it's import that they be allowed
to manage their own cache.  This maximizes the likelyhood that the ARC
will prefetch and cache the right buffers.  In the existing ZFS OSD
code a cached LU object pins buffers in the ARC preventing them from
being dropped.  As the LU cache grows it can consume the entire ARC
preventing buffers for other objects, such as the OIs, from being
cached and severely impacting the performance for FID lookups.

By default this patch will only limit the LU cache for ZFS OSDs.

NOTES:

* Setting LU_CACHE_NR_ZFS_LIMIT to 0 results in an LBUG on the MDS.
  This may be because an object is being used without a reference.
  Setting a minimum value of 256 was arbitrary, ideally we would
  set this value to 0.

* In order to be able to quickly determine the number of objects in
  the hash table the CFS_HASH_COUNTER flag is added.  This adds an
  atomic_inc/dec to the hash insert/remove paths but is not expected
  to have any measurable impact of performance.

This patch is back-ported from the following one:
Lustre-commit: 0123baecc4e2050447f8c4f48f5b33a6d3c524a8
Lustre-change: http://review.whamcloud.com/10237

Test-Parameters: alwaysuploadlogs \
mdtfilesystemtype=zfs mdsfilesystemtype=zfs ostfilesystemtype=zfs \
testgroup=review-zfs

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Change-Id: If573f02175a02abeeb100ed74f3109e629d4c392
Reviewed-on: http://review.whamcloud.com/12001
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/lu_object.c