[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAofZF58s-q4WxOFYk1K29x+ceiX7rjFuNo498VVqL5AZckkNw@mail.gmail.com>
Date: Mon, 12 Jan 2026 17:10:12 +0100
From: Marco Crivellari <marco.crivellari@...e.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Boqun Feng <boqun.feng@...il.com>, Tejun Heo <tj@...nel.org>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org, Lai Jiangshan <jiangshanlai@...il.com>,
Frederic Weisbecker <frederic@...nel.org>, Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Michal Hocko <mhocko@...e.com>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>
Subject: Re: [PATCH v3 2/2] rust: add system_percpu() around the new system_percpu_wq
On Mon, Jan 12, 2026 at 10:05 AM Alice Ryhl <aliceryhl@...gle.com> wrote:
> [...]
> Yes, we can provide a new `struct PerCpuQueue` with same contents as
> `Queue`, where the `enqueue` and `enqueue_delayed` methods take a cpu id
> parameter.
>
> Then, all of the functions for obtaining queues at the bottom of the
> file are updated to return &PerCpuQueue instead of &Queue when a cpu id
> sone option here is tohould be provided to spawn on that queue.
>
> This way, you write:
>
> workqueue::system().enqueue(my_work_item)
>
> or you write:
>
> workqueue::system_percpu().enqueue(my_work_item, cpu_id)
>
> This way you must supply cpu id with system_percpu_wq() but not with
> system().
>
> --
>
> Another approach is to add a new `enqueue_cpu` to the existing `Queue`
> struct. In that case, all of these four combinations become legal:
>
> workqueue::system().enqueue(my_work_item)
> workqueue::system().enqueue_cpu(my_work_item, cpu_id)
> workqueue::system_percpu().enqueue(my_work_item)
> workqueue::system_percpu().enqueue_cpu(my_work_item, cpu_id)
>
> which approach is best depends on whether you want all four combinations
> to be legal or not.
>
> Alice
Thank you Alice.
Personally I'm more oriented to the 1st version you mentioned. Seems a
cleaner interface for the user.
Should I start with a new v1 about this, or better increment the actual version?
Thank you!
--
Marco Crivellari
L3 Support Engineer
Powered by blists - more mailing lists