[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH5fLggwRc51eVHAtKO-nUNKJt98PpMOGq2Nrnivh047AGPMaQ@mail.gmail.com>
Date: Mon, 12 Jan 2026 17:22:50 +0100
From: Alice Ryhl <aliceryhl@...gle.com>
To: Marco Crivellari <marco.crivellari@...e.com>, Tejun Heo <tj@...nel.org>
Cc: Boqun Feng <boqun.feng@...il.com>, 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 5:10 PM Marco Crivellari
<marco.crivellari@...e.com> wrote:
>
> 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.
It's fine with me, thanks!
Tejun, any concerns?
> Should I start with a new v1 about this, or better increment the actual version?
As long as you keep the history in the cover letter, either is fine.
Alice
Powered by blists - more mailing lists