[alsa-devel] [RFC PATCH] ALSA: hda - suspend codecs in parallel

Takashi Iwai tiwai at suse.de
Tue Nov 26 14:46:21 CET 2013


At Tue, 26 Nov 2013 13:39:03 +0000,
Lin, Mengdong wrote:
> 
> > -----Original Message-----
> > From: Takashi Iwai [mailto:tiwai at suse.de]
> > Sent: Tuesday, November 26, 2013 2:36 PM
> > To: Lin, Mengdong
> 
> > > > I thought that the recent workqueue is performed asynchronously as
> > > > default (unless an ordered workqueue is used), so it should be
> > > > enough to have a single workqueue in the bus, and flush it.
> > >
> > > If using the single work queue in the bus, I observe that the codecs are
> > suspended one after one, not in parallel.
> > 
> > You need to increase the max active of the queue via
> > workqueue_set_max_active().  Otherwise it's default to 1 when you
> > created via create_workqueue().  Also, it'd be better with WQ_UNBOUND
> > flag in this case, I guess.
> > 
> 
> Thank you! workqueue_set_max_active() works. I use max codec number 15 as the max_active.

You can call it just before the suspend with bus->num_codes.

> But there is no obvious improvement by using WQ_UNBOUND, so it's not used in the 2nd version patch.

WQ_UNBOUND takes effect when there are more codecs than the number of
CPUs.  You can test it with maxcpus=1 boot option, for example.


Takashi


More information about the Alsa-devel mailing list