On Tue, 29 Sep 2026 12:47:44 +0530, Mukesh Kumar Chaurasiya (IBM) wrote:
> In system_call_exception(), test_and_clear_thread_flag(TIF_SYSCALL_RET)
> performs an atomic bit test-and-clear operation on every system call entry.
> This introduces an unnecessary performance regression on the syscall fast
> path.
>
> Combine the TIF_SYSCALL_RET check with the unlikely error condition from
> syscall_enter_from_user_mode_randomize_stack() using non-atomic
> test_thread_flag(). If the flag is set or entry failed, only then clear the
> flag via clear_thread_flag() and return the error value.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/syscall: Avoid atomic test_and_clear_thread_flag on fast path
https://git.kernel.org/powerpc/c/66236558dfac63d9bea5b0b6a66a4d717529c118
cheers