Re: [PATCH v2 3/3] sched/fair: do not scribble cache-hot CPU in select_idle_cpu()

From: Madadi Vineeth Reddy
Date: Fri Dec 01 2023 - 08:56:57 EST


On 30/11/23 12:13, Chen Yu wrote:
> Hi Madadi,
>
> On Thu, Nov 30, 2023 at 1:26 AM Madadi Vineeth Reddy
> <vineethr@xxxxxxxxxxxxx> wrote:
>>
>> Hi Chen Yu,
>>
> [snip...]
>
>>
>> As per my understanding, if the task which tagged a particular CPU as cache hot has woken up before
>> the cache_hot_timeout, we still don't allow that task to run on that particular CPU. Is this correct?
>>
>
> Not exactly. When we reached select_idle_cpu(), we have already
> checked if the wakee's previous CPU
> is idle or not in select_idle_sibling(), if it is idle, we don't check
> the cache-hot tag and return the wakee's
> previous CPU directly in select_idle_sibling().

Yeah..got it. Thanks.

So, the way another task(t') can select the cache hot tagged cpu(tagged for task t) is when t' gets
it's target cpu as this cache hot tagged cpu from wake_affine() in select_task_rq_fair.
The other way being /* pick the first cache-hot CPU as the last resort */.

>
> thanks,
> Chenyu
>
>> If correct, then why don't we let the task to select the CPU if it's the one that tagged it?
>>
>> Thanks and Regards
>> Madadi Vineeth Reddy

Thanks and Regards
Madadi Vineeth Reddy