Whamcloud - gitweb
LU-2484 obd: add md_stats to MDC and LMV devices 27/4827/7
authorJohn L. Hammond <jhammond@tacc.utexas.edu>
Thu, 13 Dec 2012 21:47:00 +0000 (15:47 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Sep 2013 05:44:46 +0000 (05:44 +0000)
commit7b28134cbb00365f6fd6996979986408edab721e
tree4432e4bf233d8115e9beced7407d270e74de71d3
parent1c9d076b8f3b8d46bfcefe82a789b57d069b5857
LU-2484 obd: add md_stats to MDC and LMV devices

Enable md_stats for MDC and LMV devices and fix the definition of
EXP_MD_COUNTER_INCREMENT() so that they will be tallied. These stats
track usage of the md_ops methods (from the OBD layer, not to be
confused with md_device methods) and are exported through the files
/proc/fs/lustre/{lmv,mdc}/*/md_stats.

Rename m_sync to m_fsync making the counter name (fsync) more
intuitive. Prune the minimally useful operations from set of md_ops to
be counted. The operations counted are close, create, enqueue,
getattr, intent_lock, link, rename, setattr, fsync, readpage, unlink,
setxattr, egtxattr, intent_getattr_async, and revalidate_lock.

Add assertions to lprocfs_counter_{add,sub}() to ensure that the
counter index lies in the appropriate range for stats. Remove the
corresponding assertions from OBD_COUNTER_INCREMENT(),
EXP_COUNTER_INCREMENT(), and EXP_MD_COUNTER_INCREMENT(). Add macros
NUM_OBD_STATS and NUM_MD_STATS for use when allocating stats.

In mdt_export_stats_init() allocate and initialize the nid_stats
member of struct exp_nid_stats using only the MDT private
counters. This does not affect the contents of
/proc/fs/lustre/mdt/*/exports/*/stats but does save memory.

Add a flag to struct obd_device to indicate if EXP_COUNTER_INCREMENT()
should increment stats in the nid_stats member (as in the case of OFD)
or not (MDT).

Remove the unused member exp_md_stats from struct obd_export.

Signed-off-by: John L. Hammond <jhammond@tacc.utexas.edu>
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Idccd30e13adbc11d10b544cdfbe1d23123176e94
Reviewed-on: http://review.whamcloud.com/4827
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
13 files changed:
lustre/include/lustre_export.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/llite/file.c
lustre/lmv/lmv_obd.c
lustre/lvfs/lvfs_lib.c
lustre/mdc/mdc_request.c
lustre/mdt/mdt_fs.c
lustre/mdt/mdt_lproc.c
lustre/mgs/mgs_fs.c
lustre/obdclass/lprocfs_status.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_obd.c