From: Denis Vlasenko <vda@ilport.com.ua>
To: Arjan van de Ven <arjan@infradead.org>, Andrew Morton <akpm@osdl.org>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] deinline sleep/delay functions
Date: Thu, 30 Jun 2005 13:21:20 +0300 [thread overview]
Message-ID: <200506301321.20692.vda@ilport.com.ua> (raw)
In-Reply-To: <1120123189.3181.28.camel@laptopd505.fenrus.org>
On Thursday 30 June 2005 12:19, Arjan van de Ven wrote:
>
> > > There are a number of compile-time checks that your patch has removed
> > > which catch such things, and as such your patch is not acceptable.
> > > Some architectures have a lower threshold of acceptability for the
> > > maximum udelay value, so it's absolutely necessary to keep this.
> >
> > It removes that check from x86 - other architectures retain it.
> >
> > I don't recall seeing anyone trigger the check,
>
> I do ;) Esp in vendor out of tree crap. It's a good compile time
> diagnostic so the junk code doesnt' hit mainline but gets fixed first.
It seems my patch was incomplete.
Thinking more about it, since it exists in all arches
and also since delaying is not performance critical
(hey, if we're going to delay/sleep, we surely can burn
a few more cycles), this can be done as follows:
linux/timer.c:
void ndelay(unsigned int nsecs)
{
unsigned int m = nsecs/(1024*1024);
while (m--)
__ndelay(1024);
__ndelay(nsecs % (1024*1024));
}
void udelay(unsigned int usecs)
{
unsigned int k = usecs/1024;
while (k--)
__udelay(1024);
__udelay(usecs % 1024);
}
void mdelay(unsigned int msecs)
{
while (msecs--)
udelay(1000);
}
void ssleep(unsigned int secs)
{
msleep(secs * 1000);
}
and arches will need to only supply two functions:
__udelay(n) [n is guaranteed <1024]
__ndelay(n) [n is guaranteed <1024*1024]
For users, _any_ value, however large, will work for
any delay function.
Comments?
--
vda
next prev parent reply other threads:[~2005-06-30 10:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-30 5:52 [PATCH] deinline sleep/delay functions Denis Vlasenko
2005-06-30 8:52 ` Russell King
2005-06-30 9:11 ` Andrew Morton
2005-06-30 9:19 ` Arjan van de Ven
2005-06-30 10:21 ` Denis Vlasenko [this message]
2005-06-30 10:47 ` Arjan van de Ven
2005-06-30 11:10 ` Denis Vlasenko
2005-06-30 11:21 ` Russell King
2005-06-30 11:22 ` Arjan van de Ven
2005-06-30 11:44 ` Denis Vlasenko
2005-06-30 11:57 ` Maciej W. Rozycki
2005-06-30 12:04 ` Russell King
2005-06-30 12:20 ` Denis Vlasenko
2005-07-01 7:54 ` Vojtech Pavlik
2005-06-30 9:44 ` Russell King
2005-07-01 7:53 ` Vojtech Pavlik
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=200506301321.20692.vda@ilport.com.ua \
--to=vda@ilport.com.ua \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
/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.