Merge "kernel/sched/walt: validate runqueue entries"
This commit is contained in:
commit
7b69ee398d
@ -4046,6 +4046,7 @@ static void walt_cpu_frequency_limits(void *unused, struct cpufreq_policy *polic
|
||||
return;
|
||||
|
||||
cpu_cluster(policy->cpu)->max_freq = policy->max;
|
||||
update_cpu_capacity_helper(policy->cpu);
|
||||
}
|
||||
|
||||
static void android_rvh_sched_cpu_starting(void *unused, int cpu)
|
||||
@ -4145,6 +4146,7 @@ static void android_rvh_enqueue_task(void *unused, struct rq *rq, struct task_st
|
||||
{
|
||||
u64 wallclock;
|
||||
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
|
||||
struct walt_rq *wrq = (struct walt_rq *) rq->android_vendor_data1;
|
||||
bool double_enqueue = false;
|
||||
|
||||
if (unlikely(walt_disabled))
|
||||
@ -4152,6 +4154,9 @@ static void android_rvh_enqueue_task(void *unused, struct rq *rq, struct task_st
|
||||
|
||||
lockdep_assert_held(&rq->__lock);
|
||||
|
||||
if (!is_per_cpu_kthread(p))
|
||||
wrq->enqueue_counter++;
|
||||
|
||||
if (p->cpu != cpu_of(rq))
|
||||
WALT_BUG(WALT_BUG_UPSTREAM, p, "enqueuing on rq %d when task->cpu is %d\n",
|
||||
cpu_of(rq), p->cpu);
|
||||
|
@ -125,6 +125,7 @@ struct walt_rq {
|
||||
struct list_head mvp_tasks;
|
||||
int num_mvp_tasks;
|
||||
u64 latest_clock;
|
||||
u32 enqueue_counter;
|
||||
};
|
||||
|
||||
struct walt_sched_cluster {
|
||||
|
@ -176,13 +176,27 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf)
|
||||
rq->stop = stop;
|
||||
}
|
||||
|
||||
void __balance_callbacks(struct rq *rq);
|
||||
|
||||
static int drain_rq_cpu_stop(void *data)
|
||||
{
|
||||
struct rq *rq = this_rq();
|
||||
struct rq_flags rf;
|
||||
struct walt_rq *wrq = (struct walt_rq *) rq->android_vendor_data1;
|
||||
|
||||
rq_lock_irqsave(rq, &rf);
|
||||
migrate_tasks(rq, &rf);
|
||||
|
||||
/*
|
||||
* service any callbacks that were accumulated, prior to unlocking. such that
|
||||
* any subsequent calls to rq_lock... will see an rq->balance_callback set to
|
||||
* the default (0 or balance_push_callback);
|
||||
*/
|
||||
wrq->enqueue_counter = 0;
|
||||
__balance_callbacks(rq);
|
||||
if (wrq->enqueue_counter)
|
||||
WALT_BUG(WALT_BUG_WALT, NULL, "cpu: %d task was re-enqueued", cpu_of(rq));
|
||||
|
||||
rq_unlock_irqrestore(rq, &rf);
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user