fix: sched/tracing: Don't re-read p->state when emitting sched_switch event (v5.18)
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 4 Apr 2022 17:52:57 +0000 (13:52 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 16 Apr 2023 17:31:15 +0000 (13:31 -0400)
commit7b023c37000c5c29fb30b7b795e1da280f08cfe5
tree84167b67d03db1317d0f5216adccda294a50c36f
parentf463bb6b049f6ab380ee05ac256b756fdc9b5231
fix: sched/tracing: Don't re-read p->state when emitting sched_switch event (v5.18)

See upstream commit :

  commit fa2c3254d7cfff5f7a916ab928a562d1165f17bb
  Author: Valentin Schneider <valentin.schneider@arm.com>
  Date:   Thu Jan 20 16:25:19 2022 +0000

    sched/tracing: Don't re-read p->state when emitting sched_switch event

    As of commit

      c6e7bd7afaeb ("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.

Change-Id: I46743cd006be4b4d573cae2d77df7d6d16744d04
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/sched.h
This page took 0.026775 seconds and 4 git commands to generate.