Re: [GIT PULL] Introduce try_alloc_pages for 6.15
From: Alexei Starovoitov
Date: Sun Mar 30 2025 - 17:49:50 EST
On Sun, Mar 30, 2025 at 1:56 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> But I do think that the lock name needs fixing.
>
> "localtry_lock_t" is not a good name, and spreading that odd
> "localtry" into the actual (non-try) locking functions makes the
> naming actively insane.
>
> If the *only* operation you could do on the lock was "trylock", then
> "localtry" would be fine. Then the lock literally is a "only try"
> thing. But as it is, the naming now ends up actively broken.
>
> Honestly, the lock name should probably reflect the fact that it can
> be used from any context (with a "trylock"), not about the trylock
> part itself.
>
> So maybe "nmisafe_local_lock_t" or something in that vein?
>
> Please fix this up, There aren't *that* many users of
> "localtry_xyzzy", let's get this fixed before there are more of them.
Ok. Agree with the reasoning that the name doesn't quite fit.
nmisafe_local_lock_t name works for me,
though nmisafe_local_lock_irqsave() is a bit verbose.
Don't have better name suggestions at the moment.
Sebastian, Vlastimil,
what do you prefer ?