From 0d48009a698b0c980f63f964824b19d5eb4ad025 Mon Sep 17 00:00:00 2001 From: bobijam Date: Fri, 6 Feb 2009 02:20:38 +0000 Subject: [PATCH] Branch b1_8 b=17011 i=tom.wang i=joahnn remove redundant brw_stats on obdfilter. --- lustre/include/lustre_export.h | 1 - lustre/obdfilter/filter.c | 5 +--- lustre/obdfilter/filter_io_26.c | 61 ++++++++++++++++++++++++-------------- lustre/obdfilter/lproc_obdfilter.c | 45 +++++----------------------- 4 files changed, 46 insertions(+), 66 deletions(-) diff --git a/lustre/include/lustre_export.h b/lustre/include/lustre_export.h index f0ab6ad..8fc0610 100644 --- a/lustre/include/lustre_export.h +++ b/lustre/include/lustre_export.h @@ -87,7 +87,6 @@ struct filter_export_data { struct list_head fed_mod_list; /* files being modified */ int fed_mod_count;/* items in fed_writing list */ long fed_pending; /* bytes just being written */ - struct brw_stats fed_brw_stats; }; #define fed_lcd_lock fed_led.led_lcd_lock diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index b0f4883..3d5d3a8 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -230,13 +230,10 @@ static int filter_export_stats_init(struct obd_device *obd, struct obd_export *exp, void *client_nid) { - struct filter_export_data *fed = &exp->exp_filter_data; struct proc_dir_entry *brw_entry; int rc, newnid = 0; ENTRY; - init_brw_stats(&fed->fed_brw_stats); - if (obd_uuid_equals(&exp->exp_client_uuid, &obd->obd_uuid)) /* Self-export gets no proc entry */ RETURN(0); @@ -3292,7 +3289,7 @@ static int filter_precreate(struct obd_device *obd, struct obdo *oa, cleanup_phase = 3; CDEBUG(D_INODE, "%s: filter_precreate(od->o_gr="LPU64 - ",od->o_id="LPU64")\n", obd->obd_name, group, + ",od->o_id="LPU64")\n", obd->obd_name, group, next_id); /* We mark object SUID+SGID to flag it for accepting UID+GID diff --git a/lustre/obdfilter/filter_io_26.c b/lustre/obdfilter/filter_io_26.c index 2689ae7..776e43f 100644 --- a/lustre/obdfilter/filter_io_26.c +++ b/lustre/obdfilter/filter_io_26.c @@ -80,18 +80,32 @@ static void record_start_io(struct filter_iobuf *iobuf, int rw, int size, atomic_inc(&filter->fo_r_in_flight); lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_R_RPC_HIST], atomic_read(&filter->fo_r_in_flight)); - lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_R_DISK_IOSIZE], size); - lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_RPC_HIST], - atomic_read(&filter->fo_r_in_flight)); - lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_DISK_IOSIZE], size); + lprocfs_oh_tally_log2(&filter-> + fo_filter_stats.hist[BRW_R_DISK_IOSIZE], + size); + if (exp->exp_nid_stats && exp->exp_nid_stats->nid_brw_stats) { + lprocfs_oh_tally(&exp->exp_nid_stats->nid_brw_stats-> + hist[BRW_R_RPC_HIST], + atomic_read(&filter->fo_r_in_flight)); + lprocfs_oh_tally_log2(&exp->exp_nid_stats-> + nid_brw_stats->hist[BRW_R_DISK_IOSIZE], + size); + } } else { atomic_inc(&filter->fo_w_in_flight); lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_W_RPC_HIST], atomic_read(&filter->fo_w_in_flight)); - lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_W_DISK_IOSIZE], size); - lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_W_RPC_HIST], - atomic_read(&filter->fo_w_in_flight)); - lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_W_DISK_IOSIZE], size); + lprocfs_oh_tally_log2(&filter-> + fo_filter_stats.hist[BRW_W_DISK_IOSIZE], + size); + if (exp->exp_nid_stats && exp->exp_nid_stats->nid_brw_stats) { + lprocfs_oh_tally(&exp->exp_nid_stats->nid_brw_stats-> + hist[BRW_W_RPC_HIST], + atomic_read(&filter->fo_r_in_flight)); + lprocfs_oh_tally_log2(&exp->exp_nid_stats-> + nid_brw_stats->hist[BRW_W_DISK_IOSIZE], + size); + } } } @@ -403,31 +417,32 @@ int filter_do_bio(struct obd_export *exp, struct inode *inode, wait_event(iobuf->dr_wait, atomic_read(&iobuf->dr_numreqs) == 0); if (rw == OBD_BRW_READ) { - lprocfs_oh_tally(&obd->u.filter.fo_filter_stats.hist[BRW_R_DIO_FRAGS], frags); - lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_DIO_FRAGS], + lprocfs_oh_tally(&obd->u.filter.fo_filter_stats. + hist[BRW_R_DIO_FRAGS], frags); - lprocfs_oh_tally_log2(&obd->u.filter.fo_filter_stats.hist[BRW_R_IO_TIME], + lprocfs_oh_tally_log2(&obd->u.filter. + fo_filter_stats.hist[BRW_R_IO_TIME], jiffies - start_time); - lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_R_IO_TIME], - jiffies - start_time); if (exp->exp_nid_stats && exp->exp_nid_stats->nid_brw_stats) { - lprocfs_oh_tally(&exp->exp_nid_stats->nid_brw_stats->hist[BRW_R_DIO_FRAGS], + lprocfs_oh_tally(&exp->exp_nid_stats->nid_brw_stats-> + hist[BRW_R_DIO_FRAGS], frags); - lprocfs_oh_tally_log2(&exp->exp_nid_stats->nid_brw_stats->hist[BRW_R_IO_TIME], + lprocfs_oh_tally_log2(&exp->exp_nid_stats-> + nid_brw_stats->hist[BRW_R_IO_TIME], jiffies - start_time); } } else { - lprocfs_oh_tally(&obd->u.filter.fo_filter_stats.hist[BRW_W_DIO_FRAGS], frags); - lprocfs_oh_tally(&exp->exp_filter_data.fed_brw_stats.hist[BRW_W_DIO_FRAGS], - frags); - lprocfs_oh_tally_log2(&obd->u.filter.fo_filter_stats.hist[BRW_W_IO_TIME], + lprocfs_oh_tally(&obd->u.filter.fo_filter_stats. + hist[BRW_W_DIO_FRAGS], frags); + lprocfs_oh_tally_log2(&obd->u.filter.fo_filter_stats. + hist[BRW_W_IO_TIME], jiffies - start_time); - lprocfs_oh_tally_log2(&exp->exp_filter_data.fed_brw_stats.hist[BRW_W_IO_TIME], - jiffies - start_time); if (exp->exp_nid_stats && exp->exp_nid_stats->nid_brw_stats) { - lprocfs_oh_tally(&exp->exp_nid_stats->nid_brw_stats->hist[BRW_W_DIO_FRAGS], + lprocfs_oh_tally(&exp->exp_nid_stats->nid_brw_stats-> + hist[BRW_W_DIO_FRAGS], frags); - lprocfs_oh_tally_log2(&exp->exp_nid_stats->nid_brw_stats->hist[BRW_W_IO_TIME], + lprocfs_oh_tally_log2(&exp->exp_nid_stats-> + nid_brw_stats->hist[BRW_W_IO_TIME], jiffies - start_time); } } diff --git a/lustre/obdfilter/lproc_obdfilter.c b/lustre/obdfilter/lproc_obdfilter.c index 52801fc..dc2a396 100644 --- a/lustre/obdfilter/lproc_obdfilter.c +++ b/lustre/obdfilter/lproc_obdfilter.c @@ -332,7 +332,6 @@ void filter_tally(struct obd_export *exp, struct page **pages, int nr_pages, unsigned long *blocks, int blocks_per_page, int wr) { struct filter_obd *filter = &exp->exp_obd->u.filter; - struct filter_export_data *fed = &exp->exp_filter_data; struct page *last_page = NULL; unsigned long *last_block = NULL; unsigned long discont_pages = 0; @@ -344,8 +343,6 @@ void filter_tally(struct obd_export *exp, struct page **pages, int nr_pages, lprocfs_oh_tally_log2(&filter->fo_filter_stats.hist[BRW_R_PAGES + wr], nr_pages); - lprocfs_oh_tally_log2(&fed->fed_brw_stats.hist[BRW_R_PAGES + wr], - nr_pages); if (exp->exp_nid_stats && exp->exp_nid_stats->nid_brw_stats) lprocfs_oh_tally_log2(&exp->exp_nid_stats->nid_brw_stats-> hist[BRW_R_PAGES + wr], nr_pages); @@ -364,12 +361,8 @@ void filter_tally(struct obd_export *exp, struct page **pages, int nr_pages, lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_R_DISCONT_PAGES +wr], discont_pages); - lprocfs_oh_tally(&fed->fed_brw_stats.hist[BRW_R_DISCONT_PAGES + wr], - discont_pages); lprocfs_oh_tally(&filter->fo_filter_stats.hist[BRW_R_DISCONT_BLOCKS+wr], discont_blocks); - lprocfs_oh_tally(&fed->fed_brw_stats.hist[BRW_R_DISCONT_BLOCKS + wr], - discont_blocks); if (exp->exp_nid_stats && exp->exp_nid_stats->nid_brw_stats) { lprocfs_oh_tally_log2(&exp->exp_nid_stats->nid_brw_stats-> @@ -497,30 +490,6 @@ int lproc_filter_attach_seqstat(struct obd_device *dev) &filter_brw_stats_fops, dev); } -static int filter_per_export_stats_seq_show(struct seq_file *seq, void *v) -{ - struct filter_export_data *fed = seq->private; - - brw_stats_show(seq, &fed->fed_brw_stats); - - return 0; -} - -static ssize_t filter_per_export_stats_seq_write(struct file *file, - const char *buf, size_t len, loff_t *off) -{ - struct seq_file *seq = file->private_data; - struct filter_export_data *fed = seq->private; - int i; - - for (i = 0; i < BRW_LAST; i++) - lprocfs_oh_clear(&fed->fed_brw_stats.hist[i]); - - return len; -} - -LPROC_SEQ_FOPS(filter_per_export_stats); - void lprocfs_filter_init_vars(struct lprocfs_static_vars *lvars) { lvars->module_vars = lprocfs_filter_module_vars; @@ -529,10 +498,10 @@ void lprocfs_filter_init_vars(struct lprocfs_static_vars *lvars) static int filter_per_nid_stats_seq_show(struct seq_file *seq, void *v) { - nid_stat_t *tmp = seq->private; + nid_stat_t * stat = seq->private; - if (tmp->nid_brw_stats) - brw_stats_show(seq, tmp->nid_brw_stats); + if (stat->nid_brw_stats) + brw_stats_show(seq, stat->nid_brw_stats); return 0; } @@ -541,13 +510,13 @@ static ssize_t filter_per_nid_stats_seq_write(struct file *file, const char *buf, size_t len, loff_t *off) { - struct seq_file *seq = file->private_data; - nid_stat_t *tmp = seq->private; + struct seq_file *seq = file->private_data; + nid_stat_t *stat = seq->private; int i; - if (tmp->nid_brw_stats) + if (stat->nid_brw_stats) for (i = 0; i < BRW_LAST; i++) - lprocfs_oh_clear(&tmp->nid_brw_stats->hist[i]); + lprocfs_oh_clear(&stat->nid_brw_stats->hist[i]); return len; } -- 1.8.3.1