From: Pavel Machek <pavel@ucw.cz>
To: "Paolo 'Blaisorblade' Giarrusso" <blaisorblade@yahoo.it>
Cc: Andrew Morton <akpm@osdl.org>, Andi Kleen <ak@muc.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] Make x86_64 udelay() round up instead of down.
Date: Wed, 1 Nov 2006 17:30:43 +0100 [thread overview]
Message-ID: <20061101163043.GA2602@elf.ucw.cz> (raw)
In-Reply-To: <20061029200702.26757.12496.stgit@americanbeauty.home.lan>
Hi!
> From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
>
> Port two patches from i386 to x86_64 delay.c to make sure all rounding is done
> upward instead of downward.
>
> There is no sign in commit messages that the mismatch was done on purpose, and
> "delay() guarantees sleeping at least for the specified time" is still a valid
> rule IMHO.
> diff --git a/arch/x86_64/lib/delay.c b/arch/x86_64/lib/delay.c
> index 50be909..7514df0 100644
> --- a/arch/x86_64/lib/delay.c
> +++ b/arch/x86_64/lib/delay.c
> @@ -40,13 +40,13 @@ EXPORT_SYMBOL(__delay);
>
> inline void __const_udelay(unsigned long xloops)
> {
> - __delay((xloops * HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy) >> 32);
> + __delay((xloops * HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy) >> 32 + 1);
Well, if this should be *rounding* up, you should do
(xloops * HZ * cpu_data[raw_smp_processor_id()].loops_per_jiffy + 0xffffffff) >> 32
, no? Not sure if it matters...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2006-11-01 16:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-29 20:07 Paolo 'Blaisorblade' Giarrusso
2006-10-29 20:07 ` [PATCH 2/2] i386, x86_64: comment magic constants in delay.h Paolo 'Blaisorblade' Giarrusso
2006-11-01 16:30 ` Pavel Machek [this message]
2006-11-10 22:16 ` [PATCH 1/2] Make x86_64 udelay() round up instead of down Blaisorblade
2006-11-17 19:30 ` [PATCH 1/2] Make x86_64 udelay() round up instead of down - try2 Paolo 'Blaisorblade' Giarrusso
2006-11-17 22:00 ` Andrew Morton
2006-11-17 22:18 ` Blaisorblade
2006-11-17 19:30 ` [PATCH 2/2] i386, x86_64: comment magic constants in delay.h Paolo 'Blaisorblade' Giarrusso
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=20061101163043.GA2602@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=ak@muc.de \
--cc=akpm@osdl.org \
--cc=blaisorblade@yahoo.it \
--cc=linux-kernel@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
Powered by JetHome