mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 03:59:40 +02:00
sched/walt: enhanced debug for double enqueue/dequeue
attempt to catch double enqueue/dequeue of a task, which can impact walt accounting. Change-Id: I2ff83e75d65f083c8d2896dd10313c193a16fa7b Signed-off-by: Stephen Dickey <dickey@codeaurora.org>
This commit is contained in:
parent
594217b008
commit
2e720fa7e7
|
|
@ -79,6 +79,9 @@ struct walt_task_struct {
|
|||
* used for prediction
|
||||
*
|
||||
* 'demand_scaled' represents task's demand scaled to 1024
|
||||
*
|
||||
* 'prev_on_rq' tracks enqueue/dequeue of a task for error conditions
|
||||
* 0 = nothing, 1 = enqueued, 2 = dequeued
|
||||
*/
|
||||
u64 mark_start;
|
||||
u32 sum, demand;
|
||||
|
|
@ -110,6 +113,7 @@ struct walt_task_struct {
|
|||
u64 cpu_cycles;
|
||||
cpumask_t cpus_requested;
|
||||
bool iowaited;
|
||||
int prev_on_rq;
|
||||
};
|
||||
|
||||
#define wts_to_ts(wts) ({ \
|
||||
|
|
|
|||
|
|
@ -2217,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;
|
||||
wts->prev_on_rq = 0;
|
||||
|
||||
for (i = 0; i < NUM_BUSY_BUCKETS; ++i)
|
||||
wts->busy_buckets[i] = 0;
|
||||
|
|
@ -3800,6 +3801,15 @@ static void android_rvh_enqueue_task(void *unused, struct rq *rq, struct task_st
|
|||
|
||||
if (unlikely(walt_disabled))
|
||||
return;
|
||||
|
||||
/* catch double enqueue */
|
||||
if (wts->prev_on_rq == 1) {
|
||||
printk_deferred("WALT-BUG double enqueue detected\n");
|
||||
walt_task_dump(p);
|
||||
SCHED_BUG_ON(1);
|
||||
}
|
||||
wts->prev_on_rq = 1;
|
||||
|
||||
wts->last_enqueued_ts = wallclock;
|
||||
sched_update_nr_prod(rq->cpu, 1);
|
||||
|
||||
|
|
@ -3815,9 +3825,19 @@ static void android_rvh_enqueue_task(void *unused, struct rq *rq, struct task_st
|
|||
static void android_rvh_dequeue_task(void *unused, struct rq *rq, struct task_struct *p, int flags)
|
||||
{
|
||||
struct walt_rq *wrq = (struct walt_rq *) rq->android_vendor_data1;
|
||||
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
|
||||
|
||||
if (unlikely(walt_disabled))
|
||||
return;
|
||||
|
||||
/* catch double deq */
|
||||
if (wts->prev_on_rq == 2) {
|
||||
printk_deferred("WALT-BUG double dequeue detected\n");
|
||||
walt_task_dump(p);
|
||||
SCHED_BUG_ON(1);
|
||||
}
|
||||
|
||||
wts->prev_on_rq = 2;
|
||||
if (p == wrq->ed_task)
|
||||
is_ed_task_present(rq, sched_ktime_clock(), p);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user