Re: [PATCH] ALSA: seq: Wait for one RCU grace period when deleting all ports
From: Takashi Iwai
Date: Sun Oct 11 2026 - 04:50:21 EST
On Sun, 11 Oct 2026 00:25:40 +0200,
Ali Ahmet Memiş wrote:
>
> Since the port list was converted to RCU, snd_seq_delete_all_ports()
> calls synchronize_rcu() once per port under register_mutex. Closing a
> client with 254 ports now takes about 1.6s and every other client
> open or close waits for it.
>
> Unlink all ports first, wait for a single grace period and then free
> them.
>
> Fixes: 4c252fbc06d6 ("ALSA: seq: Use RCU for the client port list")
> Signed-off-by: Ali Ahmet Memiş <aliamemis@xxxxxxxxxxx>
> ---
> Tested in QEMU on v7.3 with lockdep and KASAN. Closing a client
> with 254 ports went from ~1.6s to ~0.02s, and a second client doing
> open/close in a loop no longer stalls. Closing the client while other
> clients send to and query its ports ran 100 rounds without reports.
Applied now to for-next branch.
Sounds like a good performance improvement.
thanks,
Takashi