OSDN Git Service

sched/core: Remove rq.hrtick_csd_pending
authorPeter Xu <peterx@redhat.com>
Mon, 16 Dec 2019 21:31:25 +0000 (16:31 -0500)
committerIngo Molnar <mingo@kernel.org>
Fri, 6 Mar 2020 12:42:28 +0000 (13:42 +0100)
Now smp_call_function_single_async() provides the protection that
we'll return with -EBUSY if the csd object is still pending, then we
don't need the rq.hrtick_csd_pending any more.

Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20191216213125.9536-4-peterx@redhat.com
kernel/sched/core.c
kernel/sched/sched.h

index 1a9983d..b70ec38 100644 (file)
@@ -269,7 +269,6 @@ static void __hrtick_start(void *arg)
 
        rq_lock(rq, &rf);
        __hrtick_restart(rq);
-       rq->hrtick_csd_pending = 0;
        rq_unlock(rq, &rf);
 }
 
@@ -293,12 +292,10 @@ void hrtick_start(struct rq *rq, u64 delay)
 
        hrtimer_set_expires(timer, time);
 
-       if (rq == this_rq()) {
+       if (rq == this_rq())
                __hrtick_restart(rq);
-       } else if (!rq->hrtick_csd_pending) {
+       else
                smp_call_function_single_async(cpu_of(rq), &rq->hrtick_csd);
-               rq->hrtick_csd_pending = 1;
-       }
 }
 
 #else
@@ -322,8 +319,6 @@ void hrtick_start(struct rq *rq, u64 delay)
 static void hrtick_rq_init(struct rq *rq)
 {
 #ifdef CONFIG_SMP
-       rq->hrtick_csd_pending = 0;
-
        rq->hrtick_csd.flags = 0;
        rq->hrtick_csd.func = __hrtick_start;
        rq->hrtick_csd.info = rq;
index 9ea6478..38e60b8 100644 (file)
@@ -967,7 +967,6 @@ struct rq {
 
 #ifdef CONFIG_SCHED_HRTICK
 #ifdef CONFIG_SMP
-       int                     hrtick_csd_pending;
        call_single_data_t      hrtick_csd;
 #endif
        struct hrtimer          hrtick_timer;