2021-01-14 08:08:29

by Zhang, Qiang

[permalink] [raw]
Subject: Question on workqueue: Manually break affinity on hotplug

Hello Peter

Excuse me, I have some questions for you, about a description of this change:

''Don't rely on the scheduler to force break affinity for us -- it will
stop doing that for per-cpu-kthreads."

this mean when cpuhotplug, scheduler do not change affinity for per-cpu-kthread's task, if we not active setting affinity?
but if per-cpu-kthread's task is not run state, when wake up, will reset it's affinity, this is done automatically.

or is it, this place modified to fit the new one hotplug mechanism which
("sched/hotplug: Consolidate task migration on CPU unplug")?

Thanks
Qiang







2021-01-14 09:15:54

by Peter Zijlstra

[permalink] [raw]
Subject: Re: Question on workqueue: Manually break affinity on hotplug

On Thu, Jan 14, 2021 at 08:03:23AM +0000, Zhang, Qiang wrote:
> Hello Peter
>
> Excuse me, I have some questions for you, about a description of this change:
>
> ''Don't rely on the scheduler to force break affinity for us -- it will
> stop doing that for per-cpu-kthreads."
>
> this mean when cpuhotplug, scheduler do not change affinity for per-cpu-kthread's task, if we not active setting affinity?
> but if per-cpu-kthread's task is not run state, when wake up, will reset it's affinity, this is done automatically.
>
> or is it, this place modified to fit the new one hotplug mechanism which
> ("sched/hotplug: Consolidate task migration on CPU unplug")?

https://lkml.kernel.org/r/[email protected]
https://lkml.kernel.org/r/[email protected]
https://lkml.kernel.org/r/[email protected]
https://lkml.kernel.org/r/[email protected]
https://lkml.kernel.org/r/[email protected]

2021-01-17 10:19:41

by Zhang, Qiang

[permalink] [raw]
Subject: 回复: Question on workqueue: Manually break affinity on hotplug

Hello Peter, Lai

Sorry to disturb again, I'm still confused, when the CPU is offline, we active call set_cpus_allowed_ptr function to reset per-cpu kthread cpumask,
in sched_cpu_dying function , migrate_tasks function will reset per-cpu kthread's cpumask on runq, even if not on runq, when wake up, other online CPUs will also be selected to run.

what I want to ask is why we take the initiative to set it up?

Thanks
Qiang


________________________________________
??????: Peter Zijlstra <[email protected]>
????ʱ??: 2021??1??14?? 17:11
?ռ???: Zhang, Qiang
????: [email protected]
????: Re: Question on workqueue: Manually break affinity on hotplug

[Please note this e-mail is from an EXTERNAL e-mail address]

On Thu, Jan 14, 2021 at 08:03:23AM +0000, Zhang, Qiang wrote:
> Hello Peter
>
> Excuse me, I have some questions for you, about a description of this change:
>
> ''Don't rely on the scheduler to force break affinity for us -- it will
> stop doing that for per-cpu-kthreads."
>
> this mean when cpuhotplug, scheduler do not change affinity for per-cpu-kthread's task, if we not active setting affinity?
> but if per-cpu-kthread's task is not run state, when wake up, will reset it's affinity, this is done automatically.
>
> or is it, this place modified to fit the new one hotplug mechanism which
> ("sched/hotplug: Consolidate task migration on CPU unplug")?

https://lkml.kernel.org/r/[email protected]
https://lkml.kernel.org/r/[email protected]
https://lkml.kernel.org/r/[email protected]
https://lkml.kernel.org/r/[email protected]
https://lkml.kernel.org/r/[email protected]