Re: [PATCH -tip 22/32] sched: Split the cookie and setup per-task cookie on fork

From: Josh Don
Date: Wed Dec 02 2020 - 01:37:15 EST


On Tue, Dec 1, 2020 at 11:35 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> So I don't think that later patch is right... That is, it works, but
> afaict it's massive overkill.
>
> COOKIE_CMP_RETURN(task_cookie);
> COOKIE_CMP_RETURN(group_cookie);
> COOKIE_CMP_RETURN(color);
>
> So if task_cookie matches, we consider group_cookie, if that matches we
> consider color.
>
> Now, afaict that's semantically exactly the same as just using the
> narrowest cookie. That is, use the task cookie if there is, and then,
> walking the cgroup hierarchy (up) pick the first cgroup cookie.
>
> (I don't understand the color thing, but lets have that discussion in
> that subthread)
>
> Which means you only need a single active cookie field.
>
> IOW, you're just making things complicated and expensive.
>

For the per-task interface, I believe we still want to prevent two
tasks that share a task cookie from sharing an overall cookie if they
are in two separately tagged groups (Joel please correct me if I'm
mistaken there). That's why in Joel's older patch, the overall cookie
was a combination of the task and group cookies. My concern about
that was the potential cookie collision.

I followed up on the 'color' portion in the other thread.

Thanks,
Josh