From: liuy Date: Thu, 30 Aug 2007 10:11:07 +0000 (+0000) Subject: Branch b1_6 X-Git-Tag: v1_8_0_110~1289 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=55ff4a964d6c7e74edb38e0349dec5cc84991b1e;p=fs%2Flustre-release.git Branch b1_6 b=12398 i=green, nathan patch by Andreas Description: testing performance impact of enabling checksumming Details : enable checksum by default, allow --disable-checksum configure option and "-o nochecksum" mount option --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 236ead4..9ac9f75 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -122,6 +122,12 @@ Details : with NFS, the anon dentry's parent was set to itself in d_alloc_anon(), so in MDS, we use rec->ur_fid1 to find the corresponding dentry other than use rec->ur_name. +Severity : normal +Bugzilla : 12398 +Description: testing performance impact of enabling checksumming +Details : enable checksum by default, allow --disable-checksum + configure option and "-o nochecksum" mount option + -------------------------------------------------------------------------------- 2007-08-27 Cluster File Systems, Inc. diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index d97ae13..ff515c5 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -352,6 +352,23 @@ fi ]) # +# LC_CONFIG_CHECKSUM +# +# do checksum of bulk data between client and OST +# +AC_DEFUN([LC_CONFIG_CHECKSUM], +[AC_MSG_CHECKING([whether to enable data checksum support]) +AC_ARG_ENABLE([checksum], + AC_HELP_STRING([--disable-checksum], + [disable data checksum support]), + [],[enable_checksum='yes']) +AC_MSG_RESULT([$enable_checksum]) +if test x$enable_checksum != xno ; then + AC_DEFINE(ENABLE_CHECKSUM, 1, do data checksums) +fi +]) + +# # LC_CONFIG_HEALTH_CHECK_WRITE # # Turn on the actual write to the disk @@ -1133,6 +1150,7 @@ if test x$enable_server = xyes ; then LC_CONFIG_BACKINGFS fi LC_CONFIG_PINGER +LC_CONFIG_CHECKSUM LC_CONFIG_LIBLUSTRE_RECOVERY LC_CONFIG_QUOTA LC_CONFIG_HEALTH_CHECK_WRITE diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index f6edb49..2ea0d26 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -265,6 +265,9 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) spin_lock_init(&cli->cl_write_page_hist.oh_lock); spin_lock_init(&cli->cl_read_offset_hist.oh_lock); spin_lock_init(&cli->cl_write_offset_hist.oh_lock); +#ifdef ENABLE_CHECKSUM + cli->cl_checksum = 1; +#endif /* This value may be changed at connect time in ptlrpc_connect_interpret. */ diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 39990cd..97dc9d7 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -86,11 +86,15 @@ static struct ll_sb_info *ll_init_sbi(void) list_add_tail(&sbi->ll_list, &ll_super_blocks); spin_unlock(&ll_sb_lock); +#ifdef ENABLE_CHECKSUM + sbi->ll_flags |= LL_SBI_CHECKSUM; +#endif + #ifdef HAVE_EXPORT___IGET INIT_LIST_HEAD(&sbi->ll_deathrow); spin_lock_init(&sbi->ll_deathrow_lock); #endif - for (i = 0; i <= LL_PROCESS_HIST_MAX; i++) { + for (i = 0; i <= LL_PROCESS_HIST_MAX; i++) { spin_lock_init(&sbi->ll_rw_extents_info.pp_extents[i].pp_r_hist.oh_lock); spin_lock_init(&sbi->ll_rw_extents_info.pp_extents[i].pp_w_hist.oh_lock); } @@ -131,7 +135,7 @@ static int client_common_fill_super(struct super_block *sb, struct lustre_handle mdc_conn = {0, }; struct lustre_md md; struct obd_connect_data *data = NULL; - int err; + int err, checksum; ENTRY; obd = class_name2obd(mdc); @@ -351,6 +355,10 @@ static int client_common_fill_super(struct super_block *sb, GOTO(out_root, err); } + checksum = sbi->ll_flags & LL_SBI_CHECKSUM; + err = obd_set_info_async(sbi->ll_osc_exp, strlen("checksum"),"checksum", + sizeof(checksum), &checksum, NULL); + /* making vm readahead 0 for 2.4.x. In the case of 2.6.x, backing dev info assigned to inode mapping is used for determining maximal readahead. */ @@ -669,6 +677,17 @@ static int ll_options(char *options, int *flags) goto next; } + tmp = ll_set_opt("checksum", s1, LL_SBI_CHECKSUM); + if (tmp) { + *flags |= tmp; + goto next; + } + tmp = ll_set_opt("nochecksum", s1, LL_SBI_CHECKSUM); + if (tmp) { + *flags &= ~tmp; + goto next; + } + LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n", s1); RETURN(-EINVAL); @@ -1632,7 +1651,7 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md) inode->i_rdev = old_decode_dev(body->rdev); #endif if (body->valid & OBD_MD_FLSIZE) - inode->i_size = body->size; + i_size_write(inode, body->size); if (body->valid & OBD_MD_FLBLOCKS) inode->i_blocks = body->blocks;