Re: [PATCH v3 2/2] rust: add system_percpu() around the new system_percpu_wq
From: Alice Ryhl
Date: Mon Jan 12 2026 - 11:23:04 EST
On Mon, Jan 12, 2026 at 5:10 PM Marco Crivellari
<marco.crivellari@xxxxxxxx> wrote:
>
> On Mon, Jan 12, 2026 at 10:05 AM Alice Ryhl <aliceryhl@xxxxxxxxxx> 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