Re: [PATCH v2] signal: Skip the altstack update when not needed

From: Thomas Gleixner
Date: Mon Dec 13 2021 - 16:25:41 EST


On Fri, Dec 10 2021 at 14:55, Chang S. Bae wrote:
> do_sigaltstack() acquires sigaltstack_lock() and is used for both
> sys_sigaltstack() and restoring the sigaltstack in sys_sigreturn().
> Check for changes to the sigaltstack before taking the lock. If no
> changes were made, return before acquiring the lock.
>
> This removes lock contention from the common-case sigreturn path.
>
> Reported-by: kernel test robot <oliver.sang@xxxxxxxxx>
> [1] https://lore.kernel.org/lkml/20211207012128.GA16074@xsang-OptiPlex-9020/
> Fixes: 3aac3ebea08f ("x86/signal: Implement sigaltstack size validation")
> Signed-off-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>