sched: core: reset preemption/irqsoff disable timestamp

Preempt/irqsoff tracer notes down preemption/irqs disabled timestamp
and compares it with enable timestamp to report prolonged disabling
callers at latency tracking. But they don't reset the time stamp at
re-enable time. The time stamp could be stale and possible to report
same latency multiple times or false positive. This could be possible
when callsites uses notrace API (__preempt_) for preemption disable
and tracable API (preempt_) for enable (ex: softirq).

Fix it by resetting the preempt/irqsoff disable timestamp at
re-enable time.

Change-Id: I6790227998881922a9339869ce9ee2dab6202567
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
This commit is contained in:
Lingutla Chandrasekhar 2020-01-02 15:58:01 +05:30
parent 090c2c5774
commit 5e3f09ce21
2 changed files with 2 additions and 0 deletions

View file

@ -3447,6 +3447,7 @@ static inline void preempt_latency_stop(int val)
trace_sched_preempt_disable(delta, ps->irqs_disabled,
ps->caddr[0], ps->caddr[1],
ps->caddr[2], ps->caddr[3]);
ps->ts = 0;
trace_preempt_on(CALLER_ADDR0, get_lock_parent_ip());
}
}

View file

@ -641,6 +641,7 @@ void tracer_hardirqs_on(unsigned long a0, unsigned long a1)
delta > sysctl_irqsoff_tracing_threshold_ns)
trace_irqs_disable(delta, is->caddr[0], is->caddr[1],
is->caddr[2], is->caddr[3]);
is->ts = 0;
lockdep_on();
#endif /* CONFIG_PREEMPTIRQ_EVENTS */