Re: [PATCH RT 5/8] sched/deadline: Reclaim cpuset bandwidth in .migrate_task_rq()

From: Juri Lelli
Date: Tue Oct 01 2019 - 04:52:16 EST


On 30/09/19 11:24, Scott Wood wrote:
> On Mon, 2019-09-30 at 09:12 +0200, Juri Lelli wrote:

[...]

> > Hummm, I was actually more worried about the fact that we call free_old_
> > cpuset_bw_dl() only if p->state != TASK_WAKING.
>
> Oh, right. :-P Not sure what I had in mind there; we want to call it
> regardless.
>
> I assume we need rq->lock in free_old_cpuset_bw_dl()? So something like

I think we can do with rcu_read_lock_sched() (see dl_task_can_attach()).

> this:
>
> if (p->state == TASK_WAITING)
> raw_spin_lock(&rq->lock);
> free_old_cpuset_bw_dl(rq, p);
> if (p->state != TASK_WAITING)
> return;
>
> if (p->dl.dl_non_contending) {
> ....
>
> BTW, is the full cpumask_intersects() necessary or would it suffice to see
> that the new cpu is not in the old span?

Checking new cpu only should be OK.

Thanks,

Juri