Re: [PATCH v2 0/5] Introduce QPW for per-cpu operations (v2)

From: Vlastimil Babka

Date: Wed Mar 11 2026 - 04:14:49 EST


On 3/10/26 18:12, Marcelo Tosatti wrote:
> Hi Frederic,
>
> On Thu, Mar 05, 2026 at 05:55:12PM +0100, Frederic Weisbecker wrote:
>
> Can you please be more verbose, mindful of lesser cognitive powers ? :-)
>
> Note: i also dislike the added layers (and multiple cases) QPW adds.
>
> But there is precedence with local locks...
>
> Code would be less complex in case spinlocks were added:
>
> 01b44456a7aa7c3b24fa9db7d1714b208b8ef3d8 mm/page_alloc: replace local_lock with normal spinlock
> 4b23a68f953628eb4e4b7fe1294ebf93d4b8ceee mm/page_alloc: protect PCP lists with a spinlock

Note that per bf75f200569dd05ac2112797f44548beb6b4be26 changelog this seems
it was all done for the same reasons as QPW. It's nice we got the
trylock-without-irqsave approach as a followup, but the cost of (especially
non-inlined) spin_trylock is not great, given that now we could do the
trylock-without-irqsave cheaply with local_trylock.

So that to me suggests it could be worth to try convert pcplists to QPW if
it's agreed upon as the best way forward and is merged.

> But people seem to reject that in the basis of performance
> degradation.
>