Re: [patch 16/19] sched/mmcid: Provide CID ownership mode fixup functions
From: Thomas Gleixner
Date: Tue Oct 21 2025 - 14:27:18 EST
On Mon, Oct 20 2025 at 11:27, Peter Zijlstra wrote:
> On Wed, Oct 15, 2025 at 07:29:54PM +0200, Thomas Gleixner wrote:
>
>> +static bool mm_cid_fixup_task_to_cpu(struct task_struct *t, struct mm_struct *mm)
>> +{
>> + /* Remote access to mm::mm_cid::pcpu requires rq_lock */
>> + guard(task_rq_lock)(t);
>> + if (t->mm != mm)
>> + return false;
>
> I'm slightly confused about this one; I'm assuming it is a double check
> of mm for the VM_CLONE case below, once before lock once after. Except,
> none of the scheduler locks actually serialize t->mm ...
>
> IIRC the only way to actually change ->mm is exec(), and that is under
> task_lock().
Right. That's also where the task removed itself from CID
management. Let me look at that again.