From c2ed149716e8bf13a8b75c4b9c43af6f1975caba Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Wed, 17 Feb 2021 15:38:31 -0800 Subject: [PATCH] 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 --- kernel/sched/walt/walt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/sched/walt/walt.c b/kernel/sched/walt/walt.c index 44aedc2579c6..bb0ef544a416 100644 --- a/kernel/sched/walt/walt.c +++ b/kernel/sched/walt/walt.c @@ -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),