From: Jinshan Xiong Date: Fri, 9 May 2014 00:08:14 +0000 (-0700) Subject: LU-5034 llite: Change readdir BRW metrics X-Git-Tag: 2.5.60~71 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=482b5e7f76b3fdb48c987de2f221bdcae8b4f5e2 LU-5034 llite: Change readdir BRW metrics To simplify the code, change the metrics from bytes to pages. Signed-off-by: Andreas Dilger Signed-off-by: Jinshan Xiong Change-Id: If458cb64ba5de14ed709f6fe03db956935201566 Reviewed-on: http://review.whamcloud.com/10275 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: wangdi Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 54acb3d..04c1da6 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -316,7 +316,7 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir) GOTO(out, rc = PTR_ERR(op_data)); op_data->op_hash_offset = pos; - op_data->op_max_pages = sbi->ll_md_brw_size >> PAGE_CACHE_SHIFT; + op_data->op_max_pages = sbi->ll_md_brw_pages; #ifdef HAVE_DIR_CONTEXT ctx->pos = pos; rc = ll_dir_read(inode, op_data, ctx); diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index edebe5d..dc3b644 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -524,7 +524,7 @@ struct ll_sb_info { /* =0 - hold lock over whole read/write * >0 - max. chunk to be read/written w/o lock re-acquiring */ unsigned long ll_max_rw_chunk; - unsigned int ll_md_brw_size; /* used by readdir */ + unsigned int ll_md_brw_pages; /* readdir pages per RPC */ struct lu_site *ll_site; struct cl_device *ll_cl; diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 3aa25aa..30e16fc 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -378,9 +378,9 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, sbi->ll_flags |= LL_SBI_64BIT_HASH; if (data->ocd_connect_flags & OBD_CONNECT_BRW_SIZE) - sbi->ll_md_brw_size = data->ocd_brw_size; + sbi->ll_md_brw_pages = data->ocd_brw_size >> PAGE_CACHE_SHIFT; else - sbi->ll_md_brw_size = PAGE_CACHE_SIZE; + sbi->ll_md_brw_pages = 1; if (data->ocd_connect_flags & OBD_CONNECT_LAYOUTLOCK) sbi->ll_flags |= LL_SBI_LAYOUT_LOCK; diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c index be04a1c..d942d90 100644 --- a/lustre/llite/llite_nfs.c +++ b/lustre/llite/llite_nfs.c @@ -254,8 +254,7 @@ static int ll_get_name(struct dentry *dentry, char *name, GOTO(out, rc = PTR_ERR(op_data)); op_data->op_hash_offset = 0; - op_data->op_max_pages = - ll_i2sbi(dir)->ll_md_brw_size >> PAGE_CACHE_SHIFT; + op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages; mutex_lock(&dir->i_mutex); #ifdef HAVE_DIR_CONTEXT rc = ll_dir_read(dir, op_data, &lgd.ctx); diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index 88a9bee..591958d 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -1090,8 +1090,7 @@ static int ll_statahead_thread(void *arg) RETURN(PTR_ERR(op_data)); op_data->op_hash_offset = 0; - op_data->op_max_pages = - ll_i2sbi(dir)->ll_md_brw_size >> PAGE_CACHE_SHIFT; + op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages; if (sbi->ll_flags & LL_SBI_AGL_ENABLED) ll_start_agl(parent, sai); @@ -1365,8 +1364,7 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry) */ op_data->op_stripe_offset = 0; op_data->op_hash_offset = 0; - op_data->op_max_pages = - ll_i2sbi(dir)->ll_md_brw_size >> PAGE_CACHE_SHIFT; + op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages; for (ent = ll_dir_entry_start(dir, op_data, &page); ent != NULL && !IS_ERR(ent);