From: Jiri Slaby <jirislaby@gmail.com>
To: Andreas Mohr <andi@lisas.de>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
Luca Risolia <luca.risolia@studio.unibo.it>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: V4L2 drivers: potentially dangerous and inefficient msecs_to_jiffies() calculation
Date: Mon, 14 Sep 2009 23:50:50 +0200 [thread overview]
Message-ID: <4AAEBABA.9060108@gmail.com> (raw)
In-Reply-To: <20090914213933.GA5468@rhlx01.hs-esslingen.de>
On 09/14/2009 11:39 PM, Andreas Mohr wrote:
> On Mon, Sep 14, 2009 at 11:34:40PM +0200, Jiri Slaby wrote:
>> On 09/14/2009 11:07 PM, Andreas Mohr wrote:
>>> msecs_to_jiffies(1) is quite a bit too boldly assuming
>>> that all of the msecs_to_jiffies(x) implementation branches
>>> always round up.
>>
>> They do, don't they?
>
> I'd hope so, but a slight risk remains, you never know,
> especially with 4+ or so variants...
A potential problem here is rather that it may wait longer due to
returning 1 jiffie. It's then timeout * 1000 * 1. On 250HZ system it
makes a difference of multiple of 4. Don't think it's a real issue in
those drivers at all, but it's worth fixing. Care to post a patch?
next prev parent reply other threads:[~2009-09-14 21:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 21:07 V4L2 drivers: potentially dangerous and inefficient msecs_to_jiffies() calculation Andreas Mohr
2009-09-14 21:34 ` Jiri Slaby
2009-09-14 21:39 ` Andreas Mohr
2009-09-14 21:50 ` Jiri Slaby [this message]
2009-09-14 22:13 ` Andreas Mohr
2009-09-14 21:47 ` Trent Piepho
2009-09-15 19:14 ` Marcin Slusarz
2009-09-15 19:21 ` Andreas Mohr
2009-09-19 10:08 ` Andreas Mohr
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=4AAEBABA.9060108@gmail.com \
--to=jirislaby@gmail.com \
--cc=andi@lisas.de \
--cc=g.liakhovetski@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=luca.risolia@studio.unibo.it \
--cc=mchehab@infradead.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