]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: seq: virmidi: Offload the output event processing
authorTakashi Iwai <tiwai@suse.de>
Sun, 29 Jul 2018 21:03:05 +0000 (23:03 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 30 Jul 2018 12:51:51 +0000 (14:51 +0200)
commit429cbd99969e617a9bff5e1d74f75a7e3c0d7e56
tree6718f64cfde2c98b7a3d596784a49b754beba3f7
parent114538f243269a9d8902a8821b8348a5e216f83f
ALSA: seq: virmidi: Offload the output event processing

The virmidi sequencer stuff tries to translate the rawmidi bytes to
sequencer events and deliver the packets at trigger callback.  The
amount of the whole process of these translations and deliveries
depends on the incoming rawmidi bytes, and we have no limit for that;
this was the cause of a CPU soft lockup that had been reported and
fixed recently.

Although we've fixed the soft lockup by putting the temporary unlock
and cond_resched(), it's rather a quick band aid.  In this patch,
meanwhile, the event parsing and delivery process is offloaded to a
dedicated work, and the trigger callback just kicks it off.  It has
three merits, at least:

- The processing is always done in a sleepable context, which can
  assure the event delivery with non-atomic flag without hackish
  is_atomic() usage.

- Other relevant codes can be simplified, reducing the lines

- It makes me happier

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/seq_virmidi.h
sound/core/seq/seq_virmidi.c