From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, clemens@ladisch.de
Subject: Re: [RFC][PATCH 0/3] ALSA: pcm/firewire: allow to queue period elapse event in process context
Date: Mon, 7 Jun 2021 12:05:26 +0900 [thread overview]
Message-ID: <20210607030526.GA28941@workstation> (raw)
In-Reply-To: <s5h5yyrfg52.wl-tiwai@suse.de>
Hi,
On Sun, Jun 06, 2021 at 12:20:57PM +0200, Takashi Iwai wrote:
> On Sun, 06 Jun 2021 11:18:35 +0200,
> Takashi Sakamoto wrote:
> >
> > Hi,
> >
> > All of drivers in ALSA firewire stack processes two chances to process
> > isochronous packets in any isochronous context; in software IRQ context
> > for 1394 OHCI, and in process context of ALSA PCM application.
> >
> > In the process context, callbacks of .pointer and .ack are utilized. The
> > callbacks are done by ALSA PCM core under acquiring lock of PCM substream,
> >
> > In design of ALSA PCM core, call of snd_pcm_period_elapsed() is used for
> > drivers to awaken user processes from waiting for available frames. The
> > function voluntarily acquires lock of PCM substream, therefore it is not
> > called in the process context since it causes dead lock. As a workaround
> > to avoid the dead lock, all of drivers in ALSA firewire stack uses
> > workqueue to delegate the call.
> >
> > This patchset is my attempt for the issue. A variant of
> > 'snd_pcm_period_elapsed()' without lock acquisition is going to be added,
> > named 'snd_pcm_period_elapsed_without_lock()'. This is used in callbacks
> > of .pointer and .ack of snd_pcm_ops structure.
> >
> > The patchset is still under my test, but it looks to work well in my
> > easy and rough test. Before posting for merge, I'd like to get your
> > comment to the idea. When evaluating, please merge below two histories:
> > * 64584f329352 (for-next)
> > * 9981b20a5e36 (for-linus)
> >
> > Takashi Sakamoto (3):
> > ALSA: pcm: add snd_pcm_period_elapsed() variant without acquiring lock
> > of PCM substream
> > ALSA: firewire-lib: queue event of period elapse in process context
> > ALSA: firewire-lib: obsolete workqueue for period update
>
> The idea is fine, but moving snd_pcm_period_elapsed() as inline static
> doesn't give much benefit, IMO. Although it can avoid an exported
> symbol, its cost is much higher, since it'd expand the code at each
> place of snd_pcm_period_elapsed(), i.e. almost in all driver code.
> Just provide two exported functions instead in a more straightforward
> way.
Thanks for your positive comment.
I agree with it. When adding parameters for function internal, we will
discuss about the inlining for variations of kernel API again, I guess.
After merging for-linus branch into for-next branch, I'm going to post
it again. At the time, I may finish enough test.
Thanks
Takashi Sakamoto
prev parent reply other threads:[~2021-06-07 3:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-06 9:18 [RFC][PATCH 0/3] ALSA: pcm/firewire: allow to queue period elapse event in process context Takashi Sakamoto
2021-06-06 9:18 ` [RFC][PATCH 1/3] ALSA: pcm: add snd_pcm_period_elapsed() variant without acquiring lock of PCM substream Takashi Sakamoto
2021-06-06 9:18 ` [RFC][PATCH 2/3] ALSA: firewire-lib: queue event of period elapse in process context Takashi Sakamoto
2021-06-06 9:18 ` [RFC][PATCH 3/3] ALSA: firewire-lib: obsolete workqueue for period update Takashi Sakamoto
2021-06-06 11:20 ` kernel test robot
2021-06-06 11:27 ` kernel test robot
2021-06-06 10:20 ` [RFC][PATCH 0/3] ALSA: pcm/firewire: allow to queue period elapse event in process context Takashi Iwai
2021-06-07 3:05 ` Takashi Sakamoto [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210607030526.GA28941@workstation \
--to=o-takashi@sakamocchi.jp \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.