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

Madadi Vineeth Reddy
2023-12-01T13:56:57Z

On 30/11/23 12:13, Chen Yu wrote:
> Hi Madadi,
>
> On Thu, Nov 30, 2023 at 1:26 AM Madadi Vineeth Reddy
> <vineethr@linux.ibm.com> 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