From: Bernardo Innocenti <bernie@develer.com>
To: george anzinger <george@mvista.com>, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, rmk@arm.linux.org.uk, torvalds@osdl.org
Subject: Re: do_div64 generic
Date: Wed, 16 Jul 2003 20:33:34 +0200 [thread overview]
Message-ID: <200307162033.34242.bernie@develer.com> (raw)
In-Reply-To: <3F149747.3090107@mvista.com>
On Wednesday 16 July 2003 02:07, george anzinger wrote:
> > It is only used in nanosleep(), and then only in the case where the sleep
> > terminated early.
> >
> > If someone is calling nanosleep() so frequently for this to matter, the
> > time spent in divide is the least of their problems. Unless you have
> > some real-worldish benchmarks to demonstrate otherwise?
>
> It is also used in the jiffies to timespec and jiffies to timeval code
> in timer.h, if memory serves.
It's true that it's being used in more places than Andrew initially thought,
but a quick scan for jiffies_to_timeval() and jiffies_to_timespec() indicates
that it's not being used in any place where performance matters too much.
I still consider do_div() a big kludge to workaround extremely poor code
generated by GCC. If we allow this, I see no reason for not allowing a very
similar kludge which provides even better performance.
I agree with Andrew that we've run out of time for breaking things again,
so I won't be suggesting to implement a whole new set of 64bit operations
and use them all over the kernel. However, the div_long_long_rem() function
has been _already_ in use on i386 for some time, therefore the safest fix
we can do at this point is adding generic support for all other archs.
> > You know what they say about premtur optmstns, and having to propagate
> > funky new divide primitives across N architectures is indeed evil.
>
> Hm. I only want the simple div. 64-bit/32-bit in two 32-bit results.
> Is this funky? And the "evil" #ifdef allows archs to not do it.
The div_long_long_rem() interface is even somewhat cleaner than do_div() and
can be implemented easily on architectures providing a 64/32 -> 32q/32r operation
(most 32bit processors do have it).
> > Bernardo, can you do the patch please?
I would be glad to do it once the discussion has settled, whatever
the final decision will be. Just don't make me do it twice, please ;-)
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/
Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html
next prev parent reply other threads:[~2003-07-16 18:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3F1360F4.2040602@mvista.com>
2003-07-15 5:17 ` do_div64 generic Bernardo Innocenti
2003-07-15 5:38 ` Andrew Morton
2003-07-15 6:23 ` Bernardo Innocenti
2003-07-15 6:30 ` Andrew Morton
2003-07-15 21:52 ` george anzinger
2003-07-15 22:06 ` Andrew Morton
2003-07-16 0:07 ` george anzinger
2003-07-16 18:33 ` Bernardo Innocenti [this message]
2003-07-17 21:10 ` Bernardo Innocenti
2003-07-17 21:16 ` Andrew Morton
2003-07-17 22:43 ` Bernardo Innocenti
2003-07-17 23:10 ` george anzinger
2003-07-18 3:19 ` Andrew Morton
2003-07-18 4:14 ` Bernardo Innocenti
2003-07-17 23:09 ` george anzinger
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=200307162033.34242.bernie@develer.com \
--to=bernie@develer.com \
--cc=akpm@osdl.org \
--cc=george@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
--cc=torvalds@osdl.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).