diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 51703384f9c8b8a0a7893ce9f9fc23838d33d6af..c37f400fdca58c66afa8e4568ea707e73b9013e4 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -190,6 +190,12 @@ Bugzilla : 12786 Description: lfs setstripe enhancement Details : Make lfs setstripe understand 'k', 'm' and 'g' for stripe size. +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-10 Cluster File Systems, Inc. <info@clusterfs.com> diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index e563887ff63e280439bc269ac81015c67f949adf..7cbe3bd00254bfe33aac87f800069ece21e94cb2 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -351,6 +351,23 @@ if test x$enable_pinger != xno ; then 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 # @@ -1152,6 +1169,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 d5facc4b8eabaaa06defb80565f719b56a485cce..a952e99a6b04c87dfeacd60888e52cbea0550b4a 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -274,6 +274,9 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) 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 205ebf9c79788ed82ec5e0e7dd0d2d3fbcf21fe8..6d4095b7ee6e2625943399c306061288f7214f4e 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -87,11 +87,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); } @@ -168,7 +172,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, struct obd_connect_data *data = NULL; struct lustre_md lmd; obd_valid valid; - int size, err; + int size, err, checksum; ENTRY; obd = class_name2obd(md); @@ -473,6 +477,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, GOTO(out_root, err); } + checksum = sbi->ll_flags & LL_SBI_CHECKSUM; + err = obd_set_info_async(sbi->ll_dt_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. */ @@ -803,6 +811,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);