diff options
| author | Chang S. Bae <[email protected]> | 2021-12-10 22:55:03 +0000 |
|---|---|---|
| committer | Dave Hansen <[email protected]> | 2021-12-14 21:08:36 +0000 |
| commit | 6c3118c32129b4197999a8928ba776bcabd0f5c4 (patch) | |
| tree | 839fa17c2527f3ce0ad401a9bb57ff0022e598af /tools/perf/scripts/python/sctop.py | |
| parent | sched,x86: Don't use cluster topology for x86 hybrid CPUs (diff) | |
| download | kernel-6c3118c32129b4197999a8928ba776bcabd0f5c4.tar.gz kernel-6c3118c32129b4197999a8928ba776bcabd0f5c4.zip | |
signal: Skip the altstack update when not needed
== Background ==
Support for large, "dynamic" fpstates was recently merged. This
included code to ensure that sigaltstacks are sufficiently sized for
these large states. A new lock was added to remove races between
enabling large features and setting up sigaltstacks.
== Problem ==
The new lock (sigaltstack_lock()) is acquired in the sigreturn path
before restoring the old sigaltstack. Unfortunately, contention on the
new lock causes a measurable signal handling performance regression [1].
However, the common case is that no *changes* are made to the
sigaltstack state at sigreturn.
== Solution ==
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.
[1] https://lore.kernel.org/lkml/20211207012128.GA16074@xsang-OptiPlex-9020/
Fixes: 3aac3ebea08f ("x86/signal: Implement sigaltstack size validation")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Chang S. Bae <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/sctop.py')
0 files changed, 0 insertions, 0 deletions
