linux/kernel/sched
Peter Zijlstra 1c06918788 sched: Consider task_struct::saved_state in wait_task_inactive()
With the introduction of task_struct::saved_state in commit
5f220be214 ("sched/wakeup: Prepare for RT sleeping spin/rwlocks")
matching the task state has gotten more complicated. That same commit
changed try_to_wake_up() to consider both states, but
wait_task_inactive() has been neglected.

Sebastian noted that the wait_task_inactive() usage in
ptrace_check_attach() can misbehave when ptrace_stop() is blocked on
the tasklist_lock after it sets TASK_TRACED.

Therefore extract a common helper from ttwu_state_match() and use that
to teach wait_task_inactive() about the PREEMPT_RT locks.

Originally-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lkml.kernel.org/r/20230601091234.GW83892@hirez.programming.kicks-ass.net
2023-06-05 21:11:03 +02:00
..
autogroup.c
autogroup.h
build_policy.c
build_utility.c
clock.c sched/clock: Fix local_clock() before sched_clock_init() 2023-04-21 13:24:21 +02:00
completion.c sched/completion: Add wait_for_completion_state() 2022-09-07 21:53:49 +02:00
core.c sched: Consider task_struct::saved_state in wait_task_inactive() 2023-06-05 21:11:03 +02:00
core_sched.c sched: Rename task_running() to task_on_cpu() 2022-09-07 21:53:47 +02:00
cpuacct.c
cpudeadline.c
cpudeadline.h
cpufreq.c
cpufreq_schedutil.c cpufreq: schedutil: make kobj_type structure constant 2023-02-23 19:57:29 +01:00
cpupri.c
cpupri.h
cputime.c cputime: remove cputime_to_nsecs fallback 2022-12-27 12:52:17 +01:00
deadline.c sched/deadline: remove unused dl_bandwidth 2023-05-30 22:46:26 +02:00
debug.c sched/debug: Correct printing for rq->nr_uninterruptible 2023-05-08 10:58:39 +02:00
fair.c sched/fair: Don't balance task to its current running CPU 2023-06-05 21:08:24 +02:00
features.h
idle.c sched/idle: Mark arch_cpu_idle_dead() __noreturn 2023-03-08 08:44:28 -08:00
isolation.c
loadavg.c
Makefile
membarrier.c sched/membarrier: Introduce MEMBARRIER_CMD_GET_REGISTRATIONS 2023-01-07 11:29:29 +01:00
pelt.c
pelt.h
psi.c sched/psi: Avoid resetting the min update period when it is unnecessary 2023-05-20 12:53:16 +02:00
rt.c sched/rt: Fix bad task migration for rt tasks 2023-04-21 13:24:21 +02:00
sched-pelt.h
sched.h sched/deadline: remove unused dl_bandwidth 2023-05-30 22:46:26 +02:00
smp.h sched, smp: Trace smp callback causing an IPI 2023-03-24 11:01:29 +01:00
stats.c
stats.h sched/psi: Use task->psi_flags to clear in CPU migration 2022-10-30 10:12:15 +01:00
stop_task.c sched: Add update_current_exec_runtime helper 2022-08-27 00:05:35 +02:00
swait.c
topology.c sched/topology: Propagate SMT flags when removing degenerate domain 2023-05-08 10:58:39 +02:00
wait.c wait: Return number of exclusive waiters awaken 2022-11-16 11:33:03 -07:00
wait_bit.c wait_on_bit: add an acquire memory barrier 2022-08-26 09:30:25 -07:00