linux-stable/include
Valentin Schneider fa2c3254d7 sched/tracing: Don't re-read p->state when emitting sched_switch event
As of commit

  c6e7bd7afa ("sched/core: Optimize ttwu() spinning on p->on_cpu")

the following sequence becomes possible:

		      p->__state = TASK_INTERRUPTIBLE;
		      __schedule()
			deactivate_task(p);
  ttwu()
    READ !p->on_rq
    p->__state=TASK_WAKING
			trace_sched_switch()
			  __trace_sched_switch_state()
			    task_state_index()
			      return 0;

TASK_WAKING isn't in TASK_REPORT, so the task appears as TASK_RUNNING in
the trace event.

Prevent this by pushing the value read from __schedule() down the trace
event.

Reported-by: Abhijeet Dharmapurikar <adharmap@quicinc.com>
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20220120162520.570782-2-valentin.schneider@arm.com
2022-03-01 16:18:39 +01:00
..
acpi
asm-generic bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
clocksource
crypto lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI 2022-02-04 19:22:32 +01:00
drm
dt-bindings Fixes for omaps 2022-02-07 17:42:44 +01:00
keys
kunit kunit: replace kernel.h with the necessary inclusions 2022-01-20 08:52:54 +02:00
kvm RISCV: 2022-01-16 16:15:14 +02:00
linux sched/tracing: Don't re-read p->state when emitting sched_switch event 2022-03-01 16:18:39 +01:00
math-emu
media
memory
misc
net ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt 2022-02-17 09:48:24 -08:00
pcmcia
ras mm/hwpoison: remove MF_MSG_BUDDY_2ND and MF_MSG_POISONED_HUGE 2022-01-15 16:30:31 +02:00
rdma
scsi Merge branch 'akpm' (patches from Andrew) 2022-01-22 11:28:23 +02:00
soc
sound ASoC: Fixes for v5.17 2022-02-01 16:52:54 +01:00
target
trace sched/tracing: Don't re-read p->state when emitting sched_switch event 2022-03-01 16:18:39 +01:00
uapi Linux 5.17-rc5 2022-02-21 11:53:51 +01:00
vdso
video
xen xen: xenbus_dev.h: delete incorrect file name 2022-02-03 08:16:32 +01:00