From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
David Ellingsworth <david@identd.dyndns.org>,
hermann-pitton@arcor.de, awalls@md.metrocast.net,
dheitmueller@kernellabs.com, abraham.manu@gmail.com,
linux-media@vger.kernel.org
Subject: Re: [RFC] Serialization flag example
Date: Tue, 06 Apr 2010 11:42:11 -0300 [thread overview]
Message-ID: <4BBB4843.7030109@redhat.com> (raw)
In-Reply-To: <45a097098cc45db25ddbd05334b8be3e.squirrel@webmail.xs4all.nl>
Hans Verkuil wrote:
>> Hans Verkuil wrote:
>> - performance is important only for the ioctl's that directly handles
>> the streaming (dbuf/dqbuf & friends);
>
> What performance? These calls just block waiting for a frame. How the hell
> am I suppose to test performance anyway on something like that?
They are called on the main loop for receiving buffers. As the userspace may be
doing some video processing, by introducing latency here, you may affect the
applications. By using perf subsystem, you should be able to test how much
time is spent by an ioctl.
>
>> - videobuf has its own lock implementation;
>>
>> - a trivial mutex-based approach won't protect the stream to have
>> some parameters modified by a VIDIOC_S_* ioctl (such protection should be
>> provided by a resource locking);
>
> Generally once streaming starts drivers should return -EBUSY for such
> calls. Nothing to do with locking in general.
Yes, that's exactly what I said. This is a resource locking: you cannot
change several stream properties while streaming (yet, you can change a
few ones, like bright, contrast, etc).
>> then, maybe the better would be to not call the hooks for those ioctls.
>> It may be useful to do some perf tests and measure the real penalty before
>> adding
>> any extra code to exclude the buffer ioctls from the hook logic.
>
> Yuck. We want something easy to understand. Like: 'the hook is called for
> every ioctl'. Not: 'the hook is called for every ioctl except this one and
> this one and this one'. Then the driver might have to do different things
> for different ioctls just because some behind-the-scene logic dictated
> that the hook isn't called in some situations.
>
> I have said it before and I'll say it again: the problem with V4L2 drivers
> has never been performance since all the heavy lifting is done with DMA,
> the problem is complexity. Remember: premature optimization is the root of
> all evil. If a driver really needs the last drop of performance (for what,
> I wonder?) then it can choose to just not implement those hooks and do
> everything itself.
I tend to agree with you. All I'm saying is that it is valuable to double
check the impacts before committing it.
--
Cheers,
Mauro
next prev parent reply other threads:[~2010-04-06 14:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-03 11:55 Aw: Re: [RFC] Serialization flag example hermann-pitton
2010-04-04 3:14 ` David Ellingsworth
2010-04-05 22:46 ` Laurent Pinchart
2010-04-05 22:58 ` Hans Verkuil
2010-04-06 6:30 ` Hans Verkuil
2010-04-06 12:59 ` Mauro Carvalho Chehab
2010-04-06 13:54 ` Hans Verkuil
2010-04-06 14:42 ` Mauro Carvalho Chehab [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-04-01 17:37 Hans Verkuil
2010-04-01 18:24 ` Mauro Carvalho Chehab
2010-04-01 20:57 ` Hans Verkuil
2010-04-01 21:32 ` Mauro Carvalho Chehab
2010-04-02 8:57 ` Hans Verkuil
2010-04-02 16:06 ` Mauro Carvalho Chehab
2010-04-03 0:30 ` Andy Walls
2010-04-02 17:43 ` Manu Abraham
2010-04-02 17:53 ` Devin Heitmueller
2010-04-02 18:24 ` Manu Abraham
2010-04-02 18:34 ` Devin Heitmueller
2010-04-02 21:15 ` Mauro Carvalho Chehab
2010-04-03 0:47 ` Andy Walls
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=4BBB4843.7030109@redhat.com \
--to=mchehab@redhat.com \
--cc=abraham.manu@gmail.com \
--cc=awalls@md.metrocast.net \
--cc=david@identd.dyndns.org \
--cc=dheitmueller@kernellabs.com \
--cc=hermann-pitton@arcor.de \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--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