Re: [PATCH 1/4] Introducing qpw_lock() and per-cpu queue & flush work
From: Marcelo Tosatti
Date: Wed Feb 11 2026 - 10:44:20 EST
Hi Leonardo,
On Fri, Feb 06, 2026 at 09:16:36PM -0300, Leonardo Bras wrote:
> > ===================================================================
> > --- slab.orig/MAINTAINERS
> > +++ slab/MAINTAINERS
> > @@ -21291,6 +21291,12 @@ F: Documentation/networking/device_drive
> > F: drivers/bus/fsl-mc/
> > F: include/uapi/linux/fsl_mc.h
> >
> > +QPW
> > +M: Leonardo Bras <leobras@xxxxxxxxxx>
>
> Thanks for keeping that up :)
> Could you please change this line to
>
> +M: Leonardo Bras <leobras.c@xxxxxxxxx>
>
> As I don't have access to Red Hat's mail anymore.
> The signoffs on each commit should be fine to keep :)
Done.
>
> > +S: Supported
> > +F: include/linux/qpw.h
> > +F: kernel/qpw.c
> > +
>
> Should we also add the Documentation file as well?
>
> +F: Documentation/locking/qpwlocks.rst
Done.
> > +The queue work related functions (analogous to queue_work_on and flush_work) are:
> > +queue_percpu_work_on and flush_percpu_work.
> > +
> > +The behaviour of the QPW functions is as follows:
> > +
> > +* !CONFIG_PREEMPT_RT and !CONFIG_QPW (or CONFIG_QPW and qpw=off kernel
>
> I don't think PREEMPT_RT is needed here (maybe it was copied from the
> previous QPW version which was dependent on PREEMPT_RT?)
Ah, OK, my bad. Well, shouldnt CONFIG_PREEMPT_RT select CONFIG_QPW and
CONFIG_QPW_DEFAULT=y ?
> > +boot parameter):
> > + - qpw_lock: local_lock
> > + - qpw_lock_irqsave: local_lock_irqsave
> > + - qpw_trylock: local_trylock
> > + - qpw_trylock_irqsave: local_trylock_irqsave
> > + - qpw_unlock: local_unlock
> > + - queue_percpu_work_on: queue_work_on
> > + - flush_percpu_work: flush_work
> > +
> > +* CONFIG_PREEMPT_RT or CONFIG_QPW (and CONFIG_QPW_DEFAULT or qpw=on kernel
>
> Same here
>
> > +boot parameter),
> > + - qpw_lock: spin_lock
> > + - qpw_lock_irqsave: spin_lock_irqsave
> > + - qpw_trylock: spin_trylock
> > + - qpw_trylock_irqsave: spin_trylock_irqsave
> > + - qpw_unlock: spin_unlock
> > + - queue_percpu_work_on: executes work function on caller cpu
> > + - flush_percpu_work: empty
> > +
> > +qpw_get_cpu(work_struct), to be called from within qpw work function,
> > +returns the target cpu.
> >
> >
>
>
> Other than that, LGTM!
>
> Reviewed-by: Leonardo Bras <leobras.c@xxxxxxxxx>
>
> Thanks!
> Leo
>
>