linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] sched/idle: Fix missing need_resched() checks after rcu_idle_enter()
@ 2020-12-22  1:37 Frederic Weisbecker
  2020-12-22  1:37 ` [PATCH 1/4] sched/idle: Fix missing need_resched() check " Frederic Weisbecker
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Frederic Weisbecker @ 2020-12-22  1:37 UTC (permalink / raw)
  To: LKML
  Cc: Frederic Weisbecker, Rafael J . Wysocki, Peter Zijlstra,
	Ingo Molnar, Fabio Estevam, stable, Thomas Gleixner,
	Paul E . McKenney, Len Brown, Pengutronix Kernel Team,
	NXP Linux Team, Daniel Lezcano, Shawn Guo, Sascha Hauer

With Paul, we've been thinking that the idle loop wasn't twisted enough
yet to deserve 2020.

rcutorture, after some recent parameter changes, has been complaining
about a hung task.

It appears that rcu_idle_enter() may wake up a NOCB kthread but this
happens after the last generic need_resched() check. Some cpuidle drivers
fix it by chance but many others don't.

Here is a proposed bunch of fixes. I will need to also fix the
rcu_user_enter() case, likely using irq_work, since nohz_full requires
irq work to support self IPI.

Also more generally, this raise the question of local task wake_up()
under disabled interrupts. When a wake up occurs in a preempt disabled
section, it gets handled by the outer preempt_enable() call. There is no
similar mechanism when a wake up occurs with interrupts disabled. I guess
it is assumed to be handled, at worst, in the next tick. But a local irq
work would provide instant preemption once IRQs are re-enabled. Of course
this would only make sense in CONFIG_PREEMPTION, and when the tick is
disabled...

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git
	sched/idle

HEAD: f2fa6e4a070c1535b9edc9ee097167fd2b15d235

Thanks,
	Frederic
---

Frederic Weisbecker (4):
      sched/idle: Fix missing need_resched() check after rcu_idle_enter()
      cpuidle: Fix missing need_resched() check after rcu_idle_enter()
      ARM: imx6q: Fix missing need_resched() check after rcu_idle_enter()
      ACPI: processor: Fix missing need_resched() check after rcu_idle_enter()


 arch/arm/mach-imx/cpuidle-imx6q.c |  7 ++++++-
 drivers/acpi/processor_idle.c     | 10 ++++++++--
 drivers/cpuidle/cpuidle.c         | 33 +++++++++++++++++++++++++--------
 kernel/sched/idle.c               | 18 ++++++++++++------
 4 files changed, 51 insertions(+), 17 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-01-05 19:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22  1:37 [PATCH 0/4] sched/idle: Fix missing need_resched() checks after rcu_idle_enter() Frederic Weisbecker
2020-12-22  1:37 ` [PATCH 1/4] sched/idle: Fix missing need_resched() check " Frederic Weisbecker
2020-12-22  4:20   ` Paul E. McKenney
2020-12-22  1:37 ` [PATCH 2/4] cpuidle: " Frederic Weisbecker
2021-01-05 17:25   ` Dmitry Osipenko
2021-01-05 18:10     ` Dmitry Osipenko
2021-01-05 19:17       ` Paul E. McKenney
2020-12-22  1:37 ` [PATCH 3/4] ARM: imx6q: " Frederic Weisbecker
2020-12-22  1:37 ` [PATCH 4/4] ACPI: processor: " Frederic Weisbecker
2020-12-22 16:19 ` [PATCH 0/4] sched/idle: Fix missing need_resched() checks " Rafael J. Wysocki
2021-01-01 16:05   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).