Merge "sched/walt: Add fallback plan in WALT_BUGs"
This commit is contained in:
commit
3070dbf3be
1 changed files with 31 additions and 12 deletions
|
|
@ -419,17 +419,20 @@ update_window_start(struct rq *rq, u64 wallclock, int event)
|
|||
bool full_window;
|
||||
|
||||
if (wallclock < wrq->latest_clock) {
|
||||
printk_deferred("WALT-BUG CPU%d; wallclock=%llu(0x%llx) is lesser than latest_clock=%llu(0x%llx)",
|
||||
rq->cpu, wallclock, wallclock, wrq->latest_clock,
|
||||
wrq->latest_clock);
|
||||
WALT_PANIC(1);
|
||||
WALT_BUG(WALT_BUG_WALT, NULL,
|
||||
"on CPU%d; wallclock=%llu(0x%llx) is lesser than latest_clock=%llu(0x%llx)",
|
||||
rq->cpu, wallclock, wallclock, wrq->latest_clock,
|
||||
wrq->latest_clock);
|
||||
wallclock = wrq->latest_clock;
|
||||
}
|
||||
delta = wallclock - wrq->window_start;
|
||||
if (delta < 0) {
|
||||
printk_deferred("WALT-BUG CPU%d; wallclock=%llu(0x%llx) is lesser than window_start=%llu(0x%llx)",
|
||||
rq->cpu, wallclock, wallclock,
|
||||
wrq->window_start, wrq->window_start);
|
||||
WALT_PANIC(1);
|
||||
WALT_BUG(WALT_BUG_WALT, NULL,
|
||||
" on CPU%d; wallclock=%llu(0x%llx) is lesser than window_start=%llu(0x%llx)",
|
||||
rq->cpu, wallclock, wallclock,
|
||||
wrq->window_start, wrq->window_start);
|
||||
delta = 0;
|
||||
wallclock = wrq->window_start;
|
||||
}
|
||||
wrq->latest_clock = wallclock;
|
||||
if (delta < sched_ravg_window)
|
||||
|
|
@ -2314,10 +2317,11 @@ update_task_rq_cpu_cycles(struct task_struct *p, struct rq *rq, int event,
|
|||
time_delta = wallclock - wts->mark_start;
|
||||
|
||||
if ((s64)time_delta < 0) {
|
||||
printk_deferred("WALT-BUG pid=%u CPU%d wallclock=%llu(0x%llx) < mark_start=%llu(0x%llx) event=%d irqtime=%llu",
|
||||
p->pid, rq->cpu, wallclock, wallclock,
|
||||
wts->mark_start, wts->mark_start, event, irqtime);
|
||||
WALT_PANIC((s64)time_delta < 0);
|
||||
WALT_BUG(WALT_BUG_WALT, p,
|
||||
"WALT-BUG pid=%u CPU%d wallclock=%llu(0x%llx) < mark_start=%llu(0x%llx) event=%d irqtime=%llu",
|
||||
p->pid, rq->cpu, wallclock, wallclock,
|
||||
wts->mark_start, wts->mark_start, event, irqtime);
|
||||
time_delta = 1;
|
||||
}
|
||||
|
||||
wrq->task_exec_scale = DIV64_U64_ROUNDUP(cycles_delta *
|
||||
|
|
@ -2359,6 +2363,13 @@ static void walt_update_task_ravg(struct task_struct *p, struct rq *rq, int even
|
|||
if (!wrq->window_start || wts->mark_start == wallclock)
|
||||
return;
|
||||
|
||||
if (unlikely(!raw_spin_is_locked(&rq->__lock)))
|
||||
WALT_BUG(WALT_BUG_WALT, p,
|
||||
"on CPU%d: %s task %s(%d) unlocked access for cpu=%d suspende=%d last_clk=%llu stack[%pS <== %pS <== %pS]\n",
|
||||
raw_smp_processor_id(), __func__, p->comm, p->pid, rq->cpu,
|
||||
walt_clock_suspended, sched_clock_last,
|
||||
(void *)CALLER_ADDR0, (void *)CALLER_ADDR1, (void *)CALLER_ADDR2);
|
||||
|
||||
walt_lockdep_assert_rq(rq, p);
|
||||
|
||||
old_window_start = update_window_start(rq, wallclock, event);
|
||||
|
|
@ -4270,6 +4281,14 @@ static inline void __walt_irq_work_locked(bool is_migration, bool is_asym_migrat
|
|||
if (rq->curr) {
|
||||
/* only update ravg for locked cpus */
|
||||
if (cpumask_intersects(lock_cpus, &cluster->cpus)) {
|
||||
if (unlikely(!raw_spin_is_locked(&rq->__lock)))
|
||||
WALT_BUG(WALT_BUG_WALT, NULL,
|
||||
"WALT-BUG %s unlocked cpu=%d is_migration=%d is_asym_migration=%d is_shared_rail_migration=%d lock_cpus=%*pbl suspended=%d last_clk=%llu stack[%pS <= %pS <= %pS]\n",
|
||||
__func__, rq->cpu, is_migration, is_asym_migration,
|
||||
is_shared_rail_migration,
|
||||
cpumask_pr_args(lock_cpus), walt_clock_suspended,
|
||||
sched_clock_last, (void *)CALLER_ADDR0,
|
||||
(void *)CALLER_ADDR1, (void *)CALLER_ADDR2);
|
||||
walt_update_task_ravg(rq->curr, rq,
|
||||
TASK_UPDATE, wc, 0);
|
||||
account_load_subtractions(rq);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue