Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3da85d9 authored by Lingutla Chandrasekhar's avatar Lingutla Chandrasekhar Committed by Pavankumar Kondeti
Browse files

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: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
parent 9137f177
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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());
	}
}
+1 −0
Original line number Diff line number Diff line
@@ -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 */