From f8cce94fb78e4afb4ea6c2f56d082f90857f4a1c Mon Sep 17 00:00:00 2001 From: zhanghc Date: Mon, 8 Jun 2009 13:42:36 +0000 Subject: [PATCH] b=18787 disable per-CPU stats data structures for clients stats to shrink the memory usage i=oleg.drokin@sun.com i=hongchao.zhang@sun.com --- lustre/mds/mds_fs.c | 8 ++++---- lustre/mgs/mgs_fs.c | 13 ++++++++----- lustre/obdfilter/filter.c | 7 ++++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 1e078dc..a48a69c 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -85,7 +85,7 @@ int mds_export_stats_init(struct obd_device *obd, num_stats = (sizeof(*obd->obd_type->typ_ops) / sizeof(void *)) + LPROC_MDS_LAST - 1; tmp->nid_stats = lprocfs_alloc_stats(num_stats, - LPROCFS_STATS_FLAG_NOPERCPU); + LPROCFS_STATS_FLAG_NOPERCPU); if (tmp->nid_stats == NULL) return -ENOMEM; @@ -98,9 +98,9 @@ int mds_export_stats_init(struct obd_device *obd, mds_stats_counter_init(tmp->nid_stats); /* Always add in ldlm_stats */ - tmp->nid_ldlm_stats = lprocfs_alloc_stats(LDLM_LAST_OPC - - LDLM_FIRST_OPC, - 0); + tmp->nid_ldlm_stats = + lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC, + LPROCFS_STATS_FLAG_NOPERCPU); if (tmp->nid_ldlm_stats == NULL) return -ENOMEM; diff --git a/lustre/mgs/mgs_fs.c b/lustre/mgs/mgs_fs.c index 1b8f1804..cc6b3f0 100644 --- a/lustre/mgs/mgs_fs.c +++ b/lustre/mgs/mgs_fs.c @@ -79,22 +79,25 @@ static int mgs_export_stats_init(struct obd_device *obd, num_stats = (sizeof(*obd->obd_type->typ_ops) / sizeof(void *)) + LPROC_MGS_LAST - 1; exp->exp_ops_stats = lprocfs_alloc_stats(num_stats, - LPROCFS_STATS_FLAG_NOPERCPU); + LPROCFS_STATS_FLAG_NOPERCPU); if (exp->exp_ops_stats == NULL) return -ENOMEM; lprocfs_init_ops_stats(LPROC_MGS_LAST, exp->exp_ops_stats); mgs_stats_counter_init(exp->exp_ops_stats); - lprocfs_register_stats(exp->exp_nid_stats->nid_proc, "stats", exp->exp_ops_stats); + lprocfs_register_stats(exp->exp_nid_stats->nid_proc, "stats", + exp->exp_ops_stats); /* Always add in ldlm_stats */ - exp->exp_nid_stats->nid_ldlm_stats = lprocfs_alloc_stats(LDLM_LAST_OPC - - LDLM_FIRST_OPC, 0); + exp->exp_nid_stats->nid_ldlm_stats = + lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC, + LPROCFS_STATS_FLAG_NOPERCPU); if (exp->exp_nid_stats->nid_ldlm_stats == NULL) return -ENOMEM; lprocfs_init_ldlm_stats(exp->exp_nid_stats->nid_ldlm_stats); - rc = lprocfs_register_stats(exp->exp_nid_stats->nid_proc, "ldlm_stats", + rc = lprocfs_register_stats(exp->exp_nid_stats->nid_proc, + "ldlm_stats", exp->exp_nid_stats->nid_ldlm_stats); } diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index c534c21..7110bdc 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -216,7 +216,7 @@ static int lprocfs_init_rw_stats(struct obd_device *obd, num_stats = (sizeof(*obd->obd_type->typ_ops) / sizeof(void *)) + LPROC_FILTER_LAST - 1; - *stats = lprocfs_alloc_stats(num_stats, 0); + *stats = lprocfs_alloc_stats(num_stats, LPROCFS_STATS_FLAG_NOPERCPU); if (*stats == NULL) return -ENOMEM; @@ -280,8 +280,9 @@ static int filter_export_stats_init(struct obd_device *obd, RETURN(rc); /* Always add in ldlm_stats */ - tmp->nid_ldlm_stats = lprocfs_alloc_stats(LDLM_LAST_OPC - - LDLM_FIRST_OPC, 0); + tmp->nid_ldlm_stats = + lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC, + LPROCFS_STATS_FLAG_NOPERCPU); if (tmp->nid_ldlm_stats == NULL) return -ENOMEM; -- 1.8.3.1