mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 19:47:08 +02:00
sched/walt: debug for fixup_cumulative_runnable_avg
Catch when the rq is not the same as this task's rq. Catch a double enqueue or dequeue of the same task. Change-Id: I322588f4c8ad59ee48c6d14bd87c5db6d842e6f6 Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
This commit is contained in:
parent
717473462b
commit
594217b008
|
|
@ -292,7 +292,8 @@ static int in_sched_bug;
|
|||
})
|
||||
|
||||
static inline void
|
||||
fixup_cumulative_runnable_avg(struct task_struct *p,
|
||||
fixup_cumulative_runnable_avg(struct rq *rq,
|
||||
struct task_struct *p,
|
||||
struct walt_sched_stats *stats,
|
||||
s64 demand_scaled_delta,
|
||||
s64 pred_demand_scaled_delta)
|
||||
|
|
@ -303,6 +304,14 @@ fixup_cumulative_runnable_avg(struct task_struct *p,
|
|||
s64 pred_demands_sum_scaled =
|
||||
stats->pred_demands_sum_scaled + pred_demand_scaled_delta;
|
||||
|
||||
lockdep_assert_held(&rq->lock);
|
||||
|
||||
if (task_rq(p) != rq) {
|
||||
printk_deferred("WALT-BUG task not on rq\n");
|
||||
walt_task_dump(p);
|
||||
SCHED_BUG_ON(1);
|
||||
}
|
||||
|
||||
if (cumulative_runnable_avg_scaled < 0) {
|
||||
printk_deferred("WALT-BUG task ds=%llu is higher than cra=%llu\n",
|
||||
wts->demand_scaled, stats->cumulative_runnable_avg_scaled);
|
||||
|
|
@ -331,7 +340,7 @@ static void fixup_walt_sched_stats_common(struct rq *rq, struct task_struct *p,
|
|||
wts->pred_demand_scaled;
|
||||
struct walt_rq *wrq = (struct walt_rq *) rq->android_vendor_data1;
|
||||
|
||||
fixup_cumulative_runnable_avg(p, &wrq->walt_stats, task_load_delta,
|
||||
fixup_cumulative_runnable_avg(rq, p, &wrq->walt_stats, task_load_delta,
|
||||
pred_demand_delta);
|
||||
}
|
||||
|
||||
|
|
@ -975,6 +984,9 @@ static void fixup_busy_time(struct task_struct *p, int new_cpu)
|
|||
|
||||
wallclock = sched_ktime_clock();
|
||||
|
||||
lockdep_assert_held(src_rq->lock);
|
||||
lockdep_assert_held(dest_rq->lock);
|
||||
|
||||
walt_update_task_ravg(task_rq(p)->curr, task_rq(p),
|
||||
TASK_UPDATE,
|
||||
wallclock, 0);
|
||||
|
|
@ -2205,6 +2217,7 @@ static void init_new_task_load(struct task_struct *p)
|
|||
wts->curr_window = 0;
|
||||
wts->prev_window = 0;
|
||||
wts->active_time = 0;
|
||||
|
||||
for (i = 0; i < NUM_BUSY_BUCKETS; ++i)
|
||||
wts->busy_buckets[i] = 0;
|
||||
|
||||
|
|
@ -3625,7 +3638,7 @@ walt_inc_cumulative_runnable_avg(struct rq *rq, struct task_struct *p)
|
|||
struct walt_rq *wrq = (struct walt_rq *) rq->android_vendor_data1;
|
||||
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
|
||||
|
||||
fixup_cumulative_runnable_avg(p, &wrq->walt_stats, wts->demand_scaled,
|
||||
fixup_cumulative_runnable_avg(rq, p, &wrq->walt_stats, wts->demand_scaled,
|
||||
wts->pred_demand_scaled);
|
||||
}
|
||||
|
||||
|
|
@ -3635,7 +3648,7 @@ walt_dec_cumulative_runnable_avg(struct rq *rq, struct task_struct *p)
|
|||
struct walt_rq *wrq = (struct walt_rq *) rq->android_vendor_data1;
|
||||
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
|
||||
|
||||
fixup_cumulative_runnable_avg(p, &wrq->walt_stats,
|
||||
fixup_cumulative_runnable_avg(rq, p, &wrq->walt_stats,
|
||||
-(s64)wts->demand_scaled,
|
||||
-(s64)wts->pred_demand_scaled);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user