Re: [PATCH 2/2] sched/deadline.c: pick and check task if double_lock_balance() unlock the rq

From: Steven Rostedt
Date: Thu Apr 12 2018 - 08:12:45 EST


On Thu, 12 Apr 2018 18:58:55 +0800
Li Bin <huawei.libin@xxxxxxxxxx> wrote:

> @@ -1965,11 +1985,9 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq)
>
> /* Retry if something changed. */
> if (double_lock_balance(rq, later_rq)) {
> - if (unlikely(task_rq(task) != rq ||
> - !cpumask_test_cpu(later_rq->cpu, &task->cpus_allowed) ||
> - task_running(rq, task) ||
> - !dl_task(task) ||
> - !task_on_rq_queued(task))) {
> + struct task_struct *next_task = pick_next_pushable_dl_task(rq);

I would do the same thing here, and add the comment from rt.c as it
is the same reason.

-- Steve

> + if (unlikely(next_task != task ||
> + !cpumask_test_cpu(later_rq->cpu, &task->cpus_allowed))) {
> double_unlock_balance(rq, later_rq);
> later_rq = NULL;