[patch V5 10/12] futex: Convert to get/put_user_inline()
Linus Torvalds
torvalds at linux-foundation.org
Wed Oct 29 03:13:36 AEDT 2025
On Tue, 28 Oct 2025 at 08:56, Thomas Gleixner <tglx at linutronix.de> wrote:
>
> There was not justification for the open coded inline either and
> converting it to get/put must be a completely seperate change.
Actually, there's some justification in the original: see commit
43a43faf5376 ("futex: improve user space accesses") which talks about
the original impetus for it all: avoiding the very expensive barrier
in __get_user(), and how __get_user() itself couldn't be fixed.
So then it was converted to the modern user access helpers - including
address masking - and the inlining was mostly incidental to that, but
the commit message does point out that it actually makes the address
generation a bit cleaner in addition to avoiding the function call.
But I doubt that the extra instructions are all that noticeable.
That said - this code *is* in a very hot path on some loads, so it is
entirely possible that the inlining here is noticeable. I$ patterns in
particular can be a real thing.
(There was an additional issue of just making those user accesses -
get, put and cmpxchg - look a bit more similar)
Linus
More information about the Linuxppc-dev
mailing list