Whamcloud - gitweb
LU-12931 gnilnd: use time_after() to compare jiffies
[fs/lustre-release.git] / lnet / klnds / gnilnd / gnilnd_stack.c
index bdec685..bab50cb 100644 (file)
@@ -133,10 +133,9 @@ kgnilnd_quiesce_wait(char *reason)
                                 atomic_read(&kgnilnd_data.kgn_nthreads) -
                                 atomic_read(&kgnilnd_data.kgn_nquiesce));
                        CFS_RACE(CFS_FAIL_GNI_QUIESCE_RACE);
-                       set_current_state(TASK_UNINTERRUPTIBLE);
-                       schedule_timeout(cfs_time_seconds(1 * i));
+                       schedule_timeout_uninterruptible(cfs_time_seconds(i));
 
-                       LASSERTF(quiesce_deadline > jiffies,
+                       LASSERTF(time_after(quiesce_deadline, jiffies),
                                 "couldn't quiesce threads in %lu seconds, falling over now\n",
                                 cfs_duration_sec(quiesce_to));
                }
@@ -159,8 +158,7 @@ kgnilnd_quiesce_wait(char *reason)
                                 "%s: Waiting for %d threads to wake up\n",
                                  reason,
                                  atomic_read(&kgnilnd_data.kgn_nquiesce));
-                       set_current_state(TASK_UNINTERRUPTIBLE);
-                       schedule_timeout(cfs_time_seconds(1 * i));
+                       schedule_timeout_uninterruptible(cfs_time_seconds(i));
                }
 
                CDEBUG(D_INFO, "%s: All threads awake!\n", reason);
@@ -372,7 +370,6 @@ kgnilnd_ruhroh_thread(void *arg)
        int                i = 1;
        DEFINE_WAIT(wait);
 
-       cfs_block_allsigs();
        set_user_nice(current, *kgnilnd_tunables.kgn_nice);
        kgnilnd_data.kgn_ruhroh_running = 1;
 
@@ -422,8 +419,8 @@ kgnilnd_ruhroh_thread(void *arg)
                                i++;
                                CDEBUG(D_INFO, "Waiting for hardware quiesce "
                                               "flag to clear\n");
-                               set_current_state(TASK_UNINTERRUPTIBLE);
-                               schedule_timeout(cfs_time_seconds(1 * i));
+                               schedule_timeout_uninterruptible(
+                                       cfs_time_seconds(i));
 
                                /* If we got a quiesce event with bump info, DO THE BUMP!. */
                                if (kgnilnd_data.kgn_bump_info_rdy) {
@@ -597,8 +594,6 @@ kgnilnd_rca(void *arg)
        rs_event_t event;
        lnet_nid_t nid;
 
-       cfs_block_allsigs();
-
        /* all gnilnd threads need to run fairly urgently */
        set_user_nice(current, *kgnilnd_tunables.kgn_nice);