Whamcloud - gitweb
Branch HEAD
authorliuy <liuy>
Thu, 30 Aug 2007 11:03:58 +0000 (11:03 +0000)
committerliuy <liuy>
Thu, 30 Aug 2007 11:03:58 +0000 (11:03 +0000)
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

lustre/ChangeLog
lustre/autoconf/lustre-core.m4
lustre/ldlm/ldlm_lib.c
lustre/llite/llite_lib.c

index 5170338..c37f400 100644 (file)
@@ -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>
index e563887..7cbe3bd 100644 (file)
@@ -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 off the actual write to the disk
@@ -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
index d5facc4..a952e99 100644 (file)
@@ -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. */
index 205ebf9..6d4095b 100644 (file)
@@ -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);