linux/kernel
Frederic Weisbecker 43789ef3f7 rcu/nocb: Perform deferred wake up before last idle's need_resched() check
Entering RCU idle mode may cause a deferred wake up of an RCU NOCB_GP
kthread (rcuog) to be serviced.

Usually a local wake up happening while running the idle task is handled
in one of the need_resched() checks carefully placed within the idle
loop that can break to the scheduler.

Unfortunately the call to rcu_idle_enter() is already beyond the last
generic need_resched() check and we may halt the CPU with a resched
request unhandled, leaving the task hanging.

Fix this with splitting the rcuog wakeup handling from rcu_idle_enter()
and place it before the last generic need_resched() check in the idle
loop. It is then assumed that no call to call_rcu() will be performed
after that in the idle loop until the CPU is put in low power mode.

Fixes: 96d3fd0d31 (rcu: Break call_rcu() deadlock involving scheduler and perf)
Reported-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20210131230548.32970-3-frederic@kernel.org
2021-02-17 14:12:43 +01:00
..
bpf bpf: Fix 32 bit src register truncation on div/mod 2021-02-10 01:32:40 +01:00
cgroup cgroup: fix psi monitor for root cgroup 2021-01-19 11:37:05 -05:00
configs
debug
dma dma-mapping: benchmark: use u8 for reserved field in uAPI structure 2021-02-05 12:48:46 +01:00
entry preempt/dynamic: Provide irqentry_exit_cond_resched() static call 2021-02-17 14:12:42 +01:00
events uprobes: (Re)add missing get_uprobe() in __find_uprobe() 2021-02-17 14:12:42 +01:00
gcov init/gcov: allow CONFIG_CONSTRUCTORS on UML to fix module gcov 2021-02-05 11:03:47 -08:00
irq genirq/msi: Activate Multi-MSI early when MSI_FLAG_ACTIVATE_EARLY is set 2021-01-30 01:22:31 +01:00
kcsan
livepatch
locking rbtree, rtmutex: Use rb_add_cached() 2021-02-17 14:07:57 +01:00
power PM: hibernate: flush swap writer after marking 2021-01-25 18:52:30 +01:00
printk Merge branch 'printk-rework' into for-linus 2021-01-25 14:29:35 +01:00
rcu rcu/nocb: Perform deferred wake up before last idle's need_resched() check 2021-02-17 14:12:43 +01:00
sched rcu/nocb: Perform deferred wake up before last idle's need_resched() check 2021-02-17 14:12:43 +01:00
time ntp: Use freezable workqueue for RTC synchronization 2021-02-05 18:03:13 +01:00
trace tracing: Fix buffer overflow in trace event filter 2021-02-12 11:16:17 -08:00
.gitignore
acct.c
async.c
audit.c
audit.h
audit_fsnotify.c
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c
backtracetest.c
bounds.c
capability.c
compat.c
configs.c
context_tracking.c
cpu.c
cpu_pm.c
crash_core.c
crash_dump.c
cred.c
delayacct.c
dma.c
exec_domain.c
exit.c
extable.c
fail_function.c
fork.c
freezer.c
futex.c futex: Handle faults correctly for PI futexes 2021-01-26 15:11:00 +01:00
gen_kheaders.sh
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c
kcmp.c
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt preempt: Introduce CONFIG_PREEMPT_DYNAMIC 2021-02-17 14:12:24 +01:00
kcov.c
kexec.c
kexec_core.c kernel: kexec: remove the lock operation of system_transition_mutex 2021-01-25 18:40:37 +01:00
kexec_elf.c
kexec_file.c
kexec_internal.h
kheaders.c
kmod.c
kprobes.c kretprobe: Avoid re-registration of the same kretprobe earlier 2021-01-29 17:29:16 -05:00
ksysfs.c
kthread.c - Correct the marking of kthreads which are supposed to run on a specific, 2021-01-24 10:09:20 -08:00
latencytop.c
Makefile
module-internal.h
module.c
module_signature.c
module_signing.c
notifier.c
nsproxy.c
padata.c
panic.c
params.c
pid.c
pid_namespace.c
profile.c
ptrace.c
range.c
reboot.c
regset.c
relay.c
resource.c
resource_kunit.c
rseq.c
scftorture.c
scs.c
seccomp.c
signal.c for-linus-2021-01-24 2021-01-24 09:35:28 -08:00
smp.c smp: Process pending softirqs in flush_smp_call_function_from_idle() 2021-02-17 14:12:42 +01:00
smpboot.c kthread: Extract KTHREAD_IS_PER_CPU 2021-01-22 15:09:42 +01:00
smpboot.h
softirq.c
stackleak.c
stacktrace.c
static_call.c static_call: Allow module use without exposing static_call_key 2021-02-17 14:12:42 +01:00
stop_machine.c
sys.c
sys_ni.c
sysctl-test.c
sysctl.c
task_work.c
taskstats.c
test_kprobes.c
torture.c
tracepoint.c
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c
up.c
user-return-notifier.c
user.c
user_namespace.c
usermode_driver.c
utsname.c
utsname_sysctl.c
watch_queue.c
watchdog.c
watchdog_hld.c
workqueue.c workqueue: Restrict affinity change to rescuer 2021-01-22 15:09:43 +01:00
workqueue_internal.h