Skip to content

Commit 56c2443

Browse files
committed
Merge tag 'sched_urgent_for_v5.15_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Borislav Petkov: - Make sure the idle timer expires in hardirq context, on PREEMPT_RT - Make sure the run-queue balance callback is invoked only on the outgoing CPU * tag 'sched_urgent_for_v5.15_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Prevent balance_push() on remote runqueues sched/idle: Make the idle timer expire in hard interrupt context
2 parents 165d05d + 868ad33 commit 56c2443

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

kernel/sched/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8836,17 +8836,17 @@ static void balance_push(struct rq *rq)
88368836
struct task_struct *push_task = rq->curr;
88378837

88388838
lockdep_assert_rq_held(rq);
8839-
SCHED_WARN_ON(rq->cpu != smp_processor_id());
88408839

88418840
/*
88428841
* Ensure the thing is persistent until balance_push_set(.on = false);
88438842
*/
88448843
rq->balance_callback = &balance_push_callback;
88458844

88468845
/*
8847-
* Only active while going offline.
8846+
* Only active while going offline and when invoked on the outgoing
8847+
* CPU.
88488848
*/
8849-
if (!cpu_dying(rq->cpu))
8849+
if (!cpu_dying(rq->cpu) || rq != this_rq())
88508850
return;
88518851

88528852
/*

kernel/sched/idle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,10 @@ void play_idle_precise(u64 duration_ns, u64 latency_ns)
379379
cpuidle_use_deepest_state(latency_ns);
380380

381381
it.done = 0;
382-
hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
382+
hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
383383
it.timer.function = idle_inject_timer_fn;
384384
hrtimer_start(&it.timer, ns_to_ktime(duration_ns),
385-
HRTIMER_MODE_REL_PINNED);
385+
HRTIMER_MODE_REL_PINNED_HARD);
386386

387387
while (!READ_ONCE(it.done))
388388
do_idle();

0 commit comments

Comments
 (0)