Re: [RFD] resctrl: reassigning a running container's CTRL_MON group

From: Reinette Chatre
Date: Tue Nov 01 2022 - 12:49:13 EST


Hi Peter,

On 11/1/2022 8:53 AM, Peter Newman wrote:
> On Tue, Nov 1, 2022 at 4:23 PM Peter Newman <peternewman@xxxxxxxxxx> wrote:
>> Yes it looks like the task's rq_lock would provide the necessary
>> ordering. It's not feasible to ensure the IPI arrives before the target
>> task migrates away, but the task would need to obtain the same lock in
>> order to migrate off of its current CPU, so that alone would ensure the
>> next migration would observe the updates.
>>
>> The difficulty is this lock is private to sched/, so I'd have to propose
>> some API.

I thought that we could do something similar to cgroup_move_task(). Instead
of new API it seems that the custom is for subsystems to move their scheduler
related code to kernel/sched/. For example, a new
kernel/sched/resctrl.c that implements the task moving code that benefits
from the private sched/ APIs.

But ...

> Actually it looks like I can just use task_call_func() to lock down the
> task while we do our updates and decide if or where to send IPIs. That
> seems easy enough.

Indeed, this does look promising. Thanks for finding that.

If you do pursue something like this I assume that you have some
challenging environments in which to try it out? I am curious about the
user space visible impact of the additional locking on a task move when
the number of tasks being moved is high.

Reinette