Re: do_div64 generic

george anzinger
2003-07-15T23:53:34Z

Andrew Morton wrote:
> george anzinger <george@mvista.com> wrote:
>
>>>George, do you agree? May I go on and post a patch killing
>>>div_long_long_rem() everywhere?
>>
>>The issue is that div is a very long instruction and the do_div()
>>thing uses 2 or three of them, while the div_long_long_rem() is just
>>1. Also, a lot of archs already have the required div by a different
>>name. It all boils down to a performance thing.
>
>
> 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.
>
> 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.
>
> Bernardo, can you do the patch please?
>
>

--
George Anzinger george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml