Whamcloud - gitweb
LU-6177 lfsck: calculate the phase2 time correctly 14/14014/6
authorFan Yong <fan.yong@intel.com>
Wed, 8 Apr 2015 13:39:46 +0000 (21:39 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 1 May 2015 03:22:16 +0000 (03:22 +0000)
When the second-stage scanning finished, the assistant thread will
calculate how long the phase2 scanning has consumed by calling the
la_double_scan_result(). It should use com->lc_time_last_checkpoint,
(unfortunately it used lfsck->li_time_last_checkpoint by wrong) for
that.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I96cfdf615038f52aea0df33930226155ca61ce9b
Reviewed-on: http://review.whamcloud.com/14014
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_namespace.c

index 72a0ef3..375e64c 100644 (file)
@@ -1694,6 +1694,9 @@ int lfsck_assistant_engine(void *args)
                        lad->lad_to_post = 0;
                        LASSERT(lad->lad_post_result > 0);
 
                        lad->lad_to_post = 0;
                        LASSERT(lad->lad_post_result > 0);
 
+                       /* Wakeup the master engine to go ahead. */
+                       wake_up_all(&mthread->t_ctl_waitq);
+
                        memset(lr, 0, sizeof(*lr));
                        lr->lr_event = LE_PHASE1_DONE;
                        lr->lr_status = lad->lad_post_result;
                        memset(lr, 0, sizeof(*lr));
                        lr->lr_event = LE_PHASE1_DONE;
                        lr->lr_status = lad->lad_post_result;
@@ -1703,9 +1706,6 @@ int lfsck_assistant_engine(void *args)
                               "others for %s post: rc = %d\n",
                               lfsck_lfsck2name(lfsck),
                               lad->lad_name, rc);
                               "others for %s post: rc = %d\n",
                               lfsck_lfsck2name(lfsck),
                               lad->lad_name, rc);
-
-                       /* Wakeup the master engine to go ahead. */
-                       wake_up_all(&mthread->t_ctl_waitq);
                }
 
                if (lad->lad_to_double_scan) {
                }
 
                if (lad->lad_to_double_scan) {
index c172ce7..ca1ba12 100644 (file)
@@ -1336,7 +1336,7 @@ static int lfsck_layout_double_scan_result(const struct lu_env *env,
 
        down_write(&com->lc_sem);
        lo->ll_run_time_phase2 += cfs_duration_sec(cfs_time_current() +
 
        down_write(&com->lc_sem);
        lo->ll_run_time_phase2 += cfs_duration_sec(cfs_time_current() +
-                               HALF_SEC - lfsck->li_time_last_checkpoint);
+                                 HALF_SEC - com->lc_time_last_checkpoint);
        lo->ll_time_last_checkpoint = cfs_time_current_sec();
        lo->ll_objs_checked_phase2 += com->lc_new_checked;
 
        lo->ll_time_last_checkpoint = cfs_time_current_sec();
        lo->ll_objs_checked_phase2 += com->lc_new_checked;
 
@@ -4851,7 +4851,7 @@ static int lfsck_layout_dump(const struct lu_env *env,
 
        } else if (lo->ll_status == LS_SCANNING_PHASE2) {
                cfs_duration_t duration = cfs_time_current() -
 
        } else if (lo->ll_status == LS_SCANNING_PHASE2) {
                cfs_duration_t duration = cfs_time_current() -
-                                         lfsck->li_time_last_checkpoint;
+                                         com->lc_time_last_checkpoint;
                __u64 checked = lo->ll_objs_checked_phase2 +
                                com->lc_new_checked;
                __u64 speed1 = lo->ll_objs_checked_phase1;
                __u64 checked = lo->ll_objs_checked_phase2 +
                                com->lc_new_checked;
                __u64 speed1 = lo->ll_objs_checked_phase1;
index 55b668b..7af4eb6 100644 (file)
@@ -4356,7 +4356,7 @@ lfsck_namespace_dump(const struct lu_env *env, struct lfsck_component *com,
                lfsck_pos_dump(m, &pos, "current_position");
        } else if (ns->ln_status == LS_SCANNING_PHASE2) {
                cfs_duration_t duration = cfs_time_current() -
                lfsck_pos_dump(m, &pos, "current_position");
        } else if (ns->ln_status == LS_SCANNING_PHASE2) {
                cfs_duration_t duration = cfs_time_current() -
-                                         lfsck->li_time_last_checkpoint;
+                                         com->lc_time_last_checkpoint;
                __u64 checked = ns->ln_objs_checked_phase2 +
                                com->lc_new_checked;
                __u64 speed1 = ns->ln_items_checked;
                __u64 checked = ns->ln_objs_checked_phase2 +
                                com->lc_new_checked;
                __u64 speed1 = ns->ln_items_checked;
@@ -6168,7 +6168,7 @@ static int lfsck_namespace_double_scan_result(const struct lu_env *env,
 
        down_write(&com->lc_sem);
        ns->ln_run_time_phase2 += cfs_duration_sec(cfs_time_current() +
 
        down_write(&com->lc_sem);
        ns->ln_run_time_phase2 += cfs_duration_sec(cfs_time_current() +
-                               HALF_SEC - lfsck->li_time_last_checkpoint);
+                                 HALF_SEC - com->lc_time_last_checkpoint);
        ns->ln_time_last_checkpoint = cfs_time_current_sec();
        ns->ln_objs_checked_phase2 += com->lc_new_checked;
        com->lc_new_checked = 0;
        ns->ln_time_last_checkpoint = cfs_time_current_sec();
        ns->ln_objs_checked_phase2 += com->lc_new_checked;
        com->lc_new_checked = 0;