diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-11-29 08:02:49 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-13 09:18:51 +0100 |
commit | cabb9539dc1741b2a5bf6077a4aac8156f07a1c8 (patch) | |
tree | b6a04884f4c4627897a34c7232cd9e8b8403548f /include/sound | |
parent | 108ab9eafbbeffa17431cb1acd7a930d23bfd197 (diff) |
ALSA: pcm: Call snd_pcm_unlink() conditionally at closing
commit b51abed8355e5556886623b2772fa6b7598d2282 upstream.
Currently the PCM core calls snd_pcm_unlink() always unconditionally
at closing a stream. However, since snd_pcm_unlink() invokes the
global rwsem down, the lock can be easily contended. More badly, when
a thread runs in a high priority RT-FIFO, it may stall at spinning.
Basically the call of snd_pcm_unlink() is required only for the linked
streams that are already rare occasion. For normal use cases, this
code path is fairly superfluous.
As an optimization (and also as a workaround for the RT problem
above in normal situations without linked streams), this patch adds a
check before calling snd_pcm_unlink() and calls it only when needed.
Reported-by: Chanho Min <chanho.min@lge.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/sound')
0 files changed, 0 insertions, 0 deletions