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

From: Hillf Danton

Date: Tue Mar 10 2026 - 21:19:20 EST


On Tue, 10 Mar 2026 14:12:03 -0300 Marcelo Tosatti 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
>
> But people seem to reject that in the basis of performance degradation.
>
Given pcp_spin_lock() cut in 0f21b911011f ("mm/page_alloc: simplify and cleanup
pcp locking"), spin lock works because of trylock and fallback, so it is a special
case instead of a generic boilerplate to follow.