]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched/smp: Always define rq->hrtick_csd
authorIngo Molnar <mingo@kernel.org>
Wed, 28 May 2025 08:09:03 +0000 (10:09 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 13 Jun 2025 06:47:19 +0000 (08:47 +0200)
Simplify the scheduler by making CONFIG_SMP=y data structure
of rq->hrtick_csd unconditional.

Adjust hrtick_start() accordingly, which was split due to the
::hrtick_csd asymmetry and use the SMP version there too.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20250528080924.2273858-23-mingo@kernel.org
kernel/sched/core.c
kernel/sched/sched.h

index 9fc44f4b779ac315c065ae6baadb0498990a898a..c155ee0bd7a8506380397fa2954d90b45cf511d9 100644 (file)
@@ -851,8 +851,6 @@ static enum hrtimer_restart hrtick(struct hrtimer *timer)
        return HRTIMER_NORESTART;
 }
 
-#ifdef CONFIG_SMP
-
 static void __hrtick_restart(struct rq *rq)
 {
        struct hrtimer *timer = &rq->hrtick_timer;
@@ -897,30 +895,9 @@ void hrtick_start(struct rq *rq, u64 delay)
                smp_call_function_single_async(cpu_of(rq), &rq->hrtick_csd);
 }
 
-#else /* !CONFIG_SMP: */
-/*
- * Called to set the hrtick timer state.
- *
- * called with rq->lock held and IRQs disabled
- */
-void hrtick_start(struct rq *rq, u64 delay)
-{
-       /*
-        * Don't schedule slices shorter than 10000ns, that just
-        * doesn't make sense. Rely on vruntime for fairness.
-        */
-       delay = max_t(u64, delay, 10000LL);
-       hrtimer_start(&rq->hrtick_timer, ns_to_ktime(delay),
-                     HRTIMER_MODE_REL_PINNED_HARD);
-}
-
-#endif /* !CONFIG_SMP */
-
 static void hrtick_rq_init(struct rq *rq)
 {
-#ifdef CONFIG_SMP
        INIT_CSD(&rq->hrtick_csd, __hrtick_start, rq);
-#endif
        hrtimer_setup(&rq->hrtick_timer, hrtick, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
 }
 #else /* !CONFIG_SCHED_HRTICK: */
index 7a7ebc2a36752e68566ca945e53895e928014889..3e7151ed5e5e2f473db1844270b9709ba4f965da 100644 (file)
@@ -1219,9 +1219,7 @@ struct rq {
        long                    calc_load_active;
 
 #ifdef CONFIG_SCHED_HRTICK
-#ifdef CONFIG_SMP
        call_single_data_t      hrtick_csd;
-#endif
        struct hrtimer          hrtick_timer;
        ktime_t                 hrtick_time;
 #endif