lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aNFYVlroMXv5MAOm@2a01cb069018a81087c6c9b3bf9471d3.ipv6.abo.wanadoo.fr>
Date: Mon, 22 Sep 2025 16:08:22 +0200
From: Frederic Weisbecker <frederic@...nel.org>
To: Marco Crivellari <marco.crivellari@...e.com>
Cc: linux-kernel@...r.kernel.org, rcu@...r.kernel.org,
	Tejun Heo <tj@...nel.org>, Lai Jiangshan <jiangshanlai@...il.com>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Michal Hocko <mhocko@...e.com>, Jens Axboe <axboe@...nel.dk>,
	"Paul E . McKenney" <paulmck@...nel.org>,
	Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
	Joel Fernandes <joel@...lfernandes.org>,
	Josh Triplett <josh@...htriplett.org>,
	Boqun Feng <boqun.feng@...il.com>,
	Uladzislau Rezki <urezki@...il.com>
Subject: Re: [PATCH v2 1/3] rcu: replace use of system_wq with
 system_percpu_wq

Le Fri, Sep 19, 2025 at 04:50:37PM +0200, Marco Crivellari a écrit :
> Currently if a user enqueue a work item using schedule_delayed_work() the
> used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use
> WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to
> schedule_work() that is using system_wq and queue_work(), that makes use
> again of WORK_CPU_UNBOUND.
> 
> This lack of consistentcy cannot be addressed without refactoring the API.
> 
> system_wq is a per-CPU worqueue, yet nothing in its name tells about that
> CPU affinity constraint, which is very often not required by users. Make
> it clear by adding a system_percpu_wq.
> 
> The old wq will be kept for a few release cylces.
> 
> Suggested-by: Tejun Heo <tj@...nel.org>
> Signed-off-by: Marco Crivellari <marco.crivellari@...e.com>

Reviewed-by: Frederic Weisbecker <frederic@...nel.org>


> ---
>  kernel/rcu/tasks.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
> index f92443561d36..2dc044fd126e 100644
> --- a/kernel/rcu/tasks.h
> +++ b/kernel/rcu/tasks.h
> @@ -553,13 +553,13 @@ static void rcu_tasks_invoke_cbs(struct rcu_tasks *rtp, struct rcu_tasks_percpu
>  		rtpcp_next = rtp->rtpcp_array[index];
>  		if (rtpcp_next->cpu < smp_load_acquire(&rtp->percpu_dequeue_lim)) {
>  			cpuwq = rcu_cpu_beenfullyonline(rtpcp_next->cpu) ? rtpcp_next->cpu : WORK_CPU_UNBOUND;
> -			queue_work_on(cpuwq, system_wq, &rtpcp_next->rtp_work);
> +			queue_work_on(cpuwq, system_percpu_wq, &rtpcp_next->rtp_work);
>  			index++;
>  			if (index < num_possible_cpus()) {
>  				rtpcp_next = rtp->rtpcp_array[index];
>  				if (rtpcp_next->cpu < smp_load_acquire(&rtp->percpu_dequeue_lim)) {
>  					cpuwq = rcu_cpu_beenfullyonline(rtpcp_next->cpu) ? rtpcp_next->cpu : WORK_CPU_UNBOUND;
> -					queue_work_on(cpuwq, system_wq, &rtpcp_next->rtp_work);
> +					queue_work_on(cpuwq, system_percpu_wq, &rtpcp_next->rtp_work);
>  				}
>  			}
>  		}
> -- 
> 2.51.0
> 

-- 
Frederic Weisbecker
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ