sched/walt: improve debug for time_delta < 0

SCHED_BUG_ON is called from update_task_rq_cpu_cycles() when
current time is less than the previous recorded time for the
task. SCHED_BUG_ON isn't providing the precise details of
the time delta.

Improve the debugging such that the previous time, current, time
pid, and CPU are all printed before the scheduler dump.

Change-Id: I2156310be7db792e5579f8f56a0b653ed1ace225
Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
This commit is contained in:
Stephen Dickey 2021-02-17 15:38:31 -08:00 committed by Rishabh Bhatnagar
parent cf02ed946b
commit c2ed149716

View File

@ -2091,7 +2091,13 @@ update_task_rq_cpu_cycles(struct task_struct *p, struct rq *rq, int event,
time_delta = irqtime;
else
time_delta = wallclock - wts->mark_start;
SCHED_BUG_ON((s64)time_delta < 0);
if ((s64)time_delta < 0) {
printk_deferred("WALT-BUG pid=%u CPU%d wallclock=%llu < mark_start=%llu event=%d irqtime=%llu",
p->pid, rq->cpu, wallclock,
wts->mark_start, event, irqtime);
SCHED_BUG_ON((s64)time_delta < 0);
}
wrq->task_exec_scale = DIV64_U64_ROUNDUP(cycles_delta *
arch_scale_cpu_capacity(cpu),