[PATCH 0/7] Add wq_online_cpumask and remove cpus_read_lock() from apply_wqattrs_lock()

Lai Jiangshan posted 7 patches 1 year, 5 months ago
kernel/workqueue.c | 76 +++++++++++++++++++---------------------------
1 file changed, 32 insertions(+), 44 deletions(-)
[PATCH 0/7] Add wq_online_cpumask and remove cpus_read_lock() from apply_wqattrs_lock()
Posted by Lai Jiangshan 1 year, 5 months ago
From: Lai Jiangshan <jiangshan.ljs@antgroup.com>

The new wq_online_mask mirrors the cpu_online_mask except during
hotplugging; specifically, it differs between the hotplugging stages
of workqueue_offline_cpu() and workqueue_online_cpu(), during which
the transitioning CPU is not represented in the mask.

With wq_online_cpumask, cpus_read_lock() is unneeded for wqattrs changes.


Lai Jiangshan (7):
  workqueue: Add wq_online_cpumask
  workqueue: Simplify wq_calc_pod_cpumask() with wq_online_cpumask
  workqueue: Remove cpus_read_lock() from apply_wqattrs_lock()
  workqueue: Remove the unneeded cpumask empty check in
    wq_calc_pod_cpumask()
  workqueue: Remove the argument @cpu_going_down from
    wq_calc_pod_cpumask()
  workqueue: Remove the arguments @hotplug_cpu and @online from
    wq_update_pod()
  workqueue: Rename wq_update_pod() to unbound_wq_update_pwq()

Cc: Tejun Heo <tj@kernel.org>

 kernel/workqueue.c | 76 +++++++++++++++++++---------------------------
 1 file changed, 32 insertions(+), 44 deletions(-)

-- 
2.19.1.6.gb485710b
Re: [PATCH 0/7] Add wq_online_cpumask and remove cpus_read_lock() from apply_wqattrs_lock()
Posted by Tejun Heo 1 year, 5 months ago
On Thu, Jul 11, 2024 at 04:35:40PM +0800, Lai Jiangshan wrote:
> From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
> 
> The new wq_online_mask mirrors the cpu_online_mask except during
> hotplugging; specifically, it differs between the hotplugging stages
> of workqueue_offline_cpu() and workqueue_online_cpu(), during which
> the transitioning CPU is not represented in the mask.
> 
> With wq_online_cpumask, cpus_read_lock() is unneeded for wqattrs changes.
> 
> 
> Lai Jiangshan (7):
>   workqueue: Add wq_online_cpumask
>   workqueue: Simplify wq_calc_pod_cpumask() with wq_online_cpumask
>   workqueue: Remove cpus_read_lock() from apply_wqattrs_lock()
>   workqueue: Remove the unneeded cpumask empty check in
>     wq_calc_pod_cpumask()
>   workqueue: Remove the argument @cpu_going_down from
>     wq_calc_pod_cpumask()
>   workqueue: Remove the arguments @hotplug_cpu and @online from
>     wq_update_pod()
>   workqueue: Rename wq_update_pod() to unbound_wq_update_pwq()

Applied 1-7 to wq/for-6.11. I updated a changelog to clarify why the change
is needed.

Thanks.

-- 
tejun