diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2021-08-26 19:04:08 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-10-05 15:51:32 +0200 |
commit | c33627e9a1143afb988fb98d917c4a2faa16f9d9 (patch) | |
tree | bf52bd78fbde2ac8279d689c14c434d649eb1842 /kernel/sched/core.c | |
parent | sched/fair: Trigger nohz.next_balance updates when a CPU goes NOHZ-idle (diff) | |
download | linux-dev-c33627e9a1143afb988fb98d917c4a2faa16f9d9.tar.xz linux-dev-c33627e9a1143afb988fb98d917c4a2faa16f9d9.zip |
sched: Switch wait_task_inactive to HRTIMER_MODE_REL_HARD
With PREEMPT_RT enabled all hrtimers callbacks will be invoked in
softirq mode unless they are explicitly marked as HRTIMER_MODE_HARD.
During boot kthread_bind() is used for the creation of per-CPU threads
and then hangs in wait_task_inactive() if the ksoftirqd is not
yet up and running.
The hang disappeared since commit
26c7295be0c5e ("kthread: Do not preempt current task if it is going to call schedule()")
but enabling function trace on boot reliably leads to the freeze on boot
behaviour again.
The timer in wait_task_inactive() can not be directly used by a user
interface to abuse it and create a mass wake up of several tasks at the
same time leading to long sections with disabled interrupts.
Therefore it is safe to make the timer HRTIMER_MODE_REL_HARD.
Switch the timer to HRTIMER_MODE_REL_HARD.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210826170408.vm7rlj7odslshwch@linutronix.de
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r-- | kernel/sched/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 1bba4128a3e6..267269473d84 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3251,7 +3251,7 @@ unsigned long wait_task_inactive(struct task_struct *p, unsigned int match_state ktime_t to = NSEC_PER_SEC / HZ; set_current_state(TASK_UNINTERRUPTIBLE); - schedule_hrtimeout(&to, HRTIMER_MODE_REL); + schedule_hrtimeout(&to, HRTIMER_MODE_REL_HARD); continue; } |