From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Andy Walls <awalls@md.metrocast.net>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
linux-media@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: RFC: BKL, locking and ioctls
Date: Sun, 19 Sep 2010 17:51:24 -0300 [thread overview]
Message-ID: <4C9677CC.50609@redhat.com> (raw)
In-Reply-To: <1284926220.2079.105.camel@morgan.silverblock.net>
Em 19-09-2010 16:57, Andy Walls escreveu:
> On Sun, 2010-09-19 at 21:38 +0200, Hans Verkuil wrote:
>> On Sunday, September 19, 2010 21:10:06 Mauro Carvalho Chehab wrote:
>>> Em 19-09-2010 15:38, Andy Walls escreveu:
>>>> On Sun, 2010-09-19 at 18:10 +0200, Hans Verkuil wrote:
>>>>> On Sunday, September 19, 2010 17:38:18 Andy Walls wrote:
>
>> Requirements I can think of:
>>
>> 1) The basic capture and output streaming (either read/write or streaming I/O) must
>> perform well. There is no need to go to extreme measures here, since the typical
>> control flow is to prepare a buffer, setup the DMA and then wait for the DMA to
>> finish. So this is not terribly time sensitive and it is perfectly OK to have to
>> wait (within reason) for another ioctl from another thread to finish first.
>
> I'll add a data point to this one. A sleep in read() can noticeably
> affect application performance. Last time I had cx18 use a mutex in
> read(), live playback performance was really bad. The read() call would
> sleep for around 10 ms - not good at normal frame rates. It was a
> highly(?) contended mutex for the buffer queue between DMA and the
> read() call - bad idea.
>
> According to conversations on the ksummit2010 mailing list, the 10 ms
> sleep may have been due to the default 100 HZ tick and other reasons.
> Patches from the RT tree may be integrated soon that make mutexes
> (mutices?) much better performers.
If read() and poll() are not protected, almost all drivers will break, except, perhaps,
for cx18, ivtv and pvrusb2. Streaming data need to be protected on both, when
using mmap().
Yet, having a mutex there doesn't mean that the driver will sleep. The issue you felt
is likely due to some other trouble, and not for the mutex itself.
Cheers,
Mauro
next prev parent reply other threads:[~2010-09-19 20:51 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-19 15:38 RFC: BKL, locking and ioctls Andy Walls
2010-09-19 16:10 ` Hans Verkuil
2010-09-19 18:08 ` Mauro Carvalho Chehab
2010-09-19 18:38 ` Andy Walls
2010-09-19 19:10 ` Mauro Carvalho Chehab
2010-09-19 19:38 ` Hans Verkuil
2010-09-19 19:45 ` Hans Verkuil
2010-09-19 19:57 ` Andy Walls
2010-09-19 20:51 ` Mauro Carvalho Chehab [this message]
2010-09-20 1:52 ` Mauro Carvalho Chehab
2010-09-20 6:33 ` Hans Verkuil
-- strict thread matches above, loose matches on Subject: below --
2010-09-19 10:29 Hans Verkuil
2010-09-19 11:43 ` Mauro Carvalho Chehab
2010-09-19 14:58 ` Hans Verkuil
2010-09-19 18:29 ` Mauro Carvalho Chehab
2010-09-19 19:06 ` Hans Verkuil
2010-09-19 20:20 ` Mauro Carvalho Chehab
2010-09-19 21:02 ` Andy Walls
2010-09-19 21:17 ` Hans Verkuil
2010-09-20 0:19 ` Devin Heitmueller
2010-09-19 21:10 ` Hans Verkuil
2010-09-20 2:47 ` Mauro Carvalho Chehab
2010-09-19 19:05 ` Andy Walls
2010-09-19 19:26 ` 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=4C9677CC.50609@redhat.com \
--to=mchehab@redhat.com \
--cc=arnd@arndb.de \
--cc=awalls@md.metrocast.net \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).