From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: Ezequiel Garcia <ezequiel@collabora.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Linux Doc Mailing List <linux-doc@vger.kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Anton Leontiev <scileont@gmail.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH 2/3] media: vim2m: use per-file handler work queue
Date: Wed, 30 Jan 2019 16:00:04 -0200 [thread overview]
Message-ID: <20190130160004.4433b922@silica.lan> (raw)
In-Reply-To: <755a24c6fd7ccc34f3d3ccda8caa1dda715241ea.camel@collabora.com>
Em Wed, 30 Jan 2019 11:56:58 -0300
Ezequiel Garcia <ezequiel@collabora.com> escreveu:
> Hey Mauro,
>
> On Wed, 2019-01-30 at 11:19 -0200, Mauro Carvalho Chehab wrote:
> > Em Wed, 30 Jan 2019 09:41:44 -0300
> > Ezequiel Garcia <ezequiel@collabora.com> escreveu:
> >
> > > On Tue, 2019-01-29 at 14:00 -0200, Mauro Carvalho Chehab wrote:
> > > > It doesn't make sense to have a per-device work queue, as the
> > > > scheduler should be called per file handler. Having a single
> > > > one causes failures if multiple streams are filtered by vim2m.
> > > >
> > >
> > > Having a per-device workqueue should emulate a real device more closely.
> >
> > Yes.
> >
> > > But more importantly, why would having a single workqeueue fail if multiple
> > > streams are run? The m2m should take care of the proper serialization
> > > between multiple contexts, unless I am missing something here.
> >
> > Yes, the m2m core serializes the access to m2m src/dest buffer per device.
> >
> > So, two instances can't access the buffer at the same time. That makes
> > sense for a real physical hardware, although specifically for the virtual
> > one, it doesn't (any may not make sense for some stateless codec, if
> > the codec would internally be able to handle multiple requests at the same
> > time).
> >
> > Without this patch, when multiple instances are used, sometimes it ends
> > into a dead lock preventing to stop all of them.
> >
> > I didn't have time to debug where exactly it happens, but I suspect that
> > the issue is related to using the same mutex for both VB and open/release
> > instances.
> >
> > Yet, I ended by opting to move all queue-specific mutex/semaphore to be
> > instance-based, as this makes a lot more sense, IMHO. Also, if some day
> > we end by allowing support for some hardware that would have support to
> > run multiple m2m instances in parallel, vim2m would already be ready.
> >
>
> I don't oppose to the idea of having a per-context workqueue.
>
> However, I'm not too comfortable with having a bug somewhere (and not knowing
> whert) and instead of fixing it, working around it. I'd rather
> fix the bug instead, then decide about the workqueue.
I suspect that just using a separate mutex for open/release could
be enough to make the upstream version stable, when multiple instances
are running.
However, it has been a challenge for me to debug it here, as I'm traveling
with limited resources. I'm using the same machine for both desktop, to run
a VM to access some corp resources and to do Kernel devel.
That's usually a very bad idea. Yet, I'm pretty sure that after this patch,
things are stable, as I've been able to test it without any issues and
without needing to reboot my machine.
If you have enough time, feel free to test. Otherwise, I intend to just
apply this patch series, as it fixes a few bugs and make vim2m to
actually display what it would be expected, instead of plotting just some
weird image that the current version shows.
Cheers,
Mauro
next prev parent reply other threads:[~2019-01-30 18:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-29 16:00 [PATCH 0/3] vim2m: make it work properly Mauro Carvalho Chehab
2019-01-29 16:00 ` [PATCH 1/3] media: vim2m: fix driver for it to handle different fourcc formats Mauro Carvalho Chehab
2019-01-29 16:00 ` [PATCH 2/3] media: vim2m: use per-file handler work queue Mauro Carvalho Chehab
2019-01-30 12:41 ` Ezequiel Garcia
2019-01-30 13:19 ` Mauro Carvalho Chehab
2019-01-30 14:56 ` Ezequiel Garcia
2019-01-30 18:00 ` Mauro Carvalho Chehab [this message]
2019-01-29 16:00 ` [PATCH 3/3] media: vim2m: allow setting the default transaction time via parameter Mauro Carvalho Chehab
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=20190130160004.4433b922@silica.lan \
--to=mchehab+samsung@kernel.org \
--cc=corbet@lwn.net \
--cc=ezequiel@collabora.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-doc@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=sakari.ailus@linux.intel.com \
--cc=scileont@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox