summaryrefslogtreecommitdiff
path: root/rust/alloc/collections/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorMateusz Guzik <mjguzik@gmail.com>2025-12-03 10:28:51 +0100
committerChristian Brauner <brauner@kernel.org>2025-12-15 14:33:38 +0100
commit6d864a1b182532e7570383af8825fa4ddcd24243 (patch)
treec4d5409a5c3f3f173c86cb990d78c55fbed5905d /rust/alloc/collections/git@git.tavy.me:linux.git
parentc0aac5975bafc86f6817b14e9f71dcb5064a9183 (diff)
pid: only take pidmap_lock once on alloc
When spawning and killing threads in separate processes in parallel the primary bottleneck on the stock kernel is pidmap_lock, largely because of a back-to-back acquire in the common case. This aspect is fixed with the patch. Performance improvement varies between reboots. When benchmarking with 20 processes creating and killing threads in a loop, the unpatched baseline hovers around 465k ops/s, while patched is anything between ~510k ops/s and ~560k depending on false-sharing (which I only minimally sanitized). So this is at least 10% if you are unlucky. The change also facilitated some cosmetic fixes. It has an unintentional side effect of no longer issuing spurious idr_preload() around idr_replace(). Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Link: https://patch.msgid.link/20251203092851.287617-3-mjguzik@gmail.com Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'rust/alloc/collections/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions