]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
sched/membarrier: reduce the ability to hammer on sys_membarrier
authorLinus Torvalds <torvalds@linuxfoundation.org>
Sun, 4 Feb 2024 15:25:12 +0000 (15:25 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 20 Feb 2024 17:38:05 +0000 (09:38 -0800)
commit944d5fe50f3f03daacfea16300e656a1691c4a23
treec68e71fe16481d79f0e96fb47c94799a0a25920f
parentb401b621758e46812da61fa58a67c3fd8d91de0d
sched/membarrier: reduce the ability to hammer on sys_membarrier

On some systems, sys_membarrier can be very expensive, causing overall
slowdowns for everything.  So put a lock on the path in order to
serialize the accesses to prevent the ability for this to be called at
too high of a frequency and saturate the machine.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-and-tested-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Fixes: 22e4ebb97582 ("membarrier: Provide expedited private command")
Fixes: c5f58bd58f43 ("membarrier: Provide GLOBAL_EXPEDITED command")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/sched/membarrier.c