perf/core: Remove retry loop from perf_mmap()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 4 Nov 2024 13:39:26 +0000 (14:39 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Mar 2025 08:43:15 +0000 (09:43 +0100)
commit8eaec7bb723c9a0addfc0457e2f28e41735607af
tree0906e2a5e8c70414e88930283eb4b58d98d258c3
parent0c8a4e4139adf09b27fb910edbc596ea2d31a5db
perf/core: Remove retry loop from perf_mmap()

AFAICT there is no actual benefit from the mutex drop on re-try. The
'worst' case scenario is that we instantly re-gain the mutex without
perf_mmap_close() getting it. So might as well make that the normal
case.

Reflow the code to make the ring buffer detach case naturally flow
into the no ring buffer case.

[ mingo: Forward ported it ]

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20241104135519.463607258@infradead.org
kernel/events/core.c