Re: [PATCH v3 2/2] rust: add system_percpu() around the new system_percpu_wq

From: Marco Crivellari

Date: Fri Jan 09 2026 - 11:32:37 EST


On Thu, Oct 9, 2025 at 1:17 PM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
> [...]
> > If we were to expose the system_percpu_wq to Rust, then we should also
> > add queue_work_on() API to Rust, otherwise it's kinda pointless IMO.
> >
> > PS. We can use the CpuId abstraction:
> >
> > http://rust.docs.kernel.org/kernel/cpu/struct.CpuId.html
> >
> > and have an API like:
> >
> > ipml Queue {
> > pub fn queue_on(&self, cpu: CpuId, w: W) -> W::EqueueOutput
> > }
> >
> > or maybe a different new type `PerCpuQueue`?
> >
> > Regards,
> > Boqun
>
> How is it ... can we cleanly separate queues into those where you must
> specify the cpuid, and those where you shouldn't?

Hi,

Sorry to come back to you so late. I still had many other subsystems patches,
now there are way less, many of them are accepted.

Can I have some guidance about this? I am new to Rust.
What's the best way in order to expose the workqueues?

If I understand correctly, the Idea is extends the functionalities of:

https://rust.docs.kernel.org/kernel/workqueue/struct.Queue.html

adding the "queue_on" function.

Creating a new type like "PerCpuQueue" I guess it means... wraps always
the workqueue_struct structure and defines what's appropriate, like the
new per-cpu workqueue.

Many thanks in advance!

--

Marco Crivellari

L3 Support Engineer