lkml.org 
[lkml]   [2008]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT pull] time(r) fixes for .25
On Mon, Mar 10, 2008 at 05:44:07PM +0100, Pavel Machek wrote:
>
> > @@ -174,6 +174,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns)
> > {
> > ns += a->tv_nsec;
> > while(unlikely(ns >= NSEC_PER_SEC)) {
> > + /* The following asm() prevents the compiler from
> > + * optimising this loop into a modulo operation. */
> > + asm("" : "+r"(ns));
> > +
>
> optimizing -> pessimizing or "optimizing" or explain that "optimized"
> version is slower than real version?
>...

In this case it's actually gcc's fault to ignore the unlikely(), so the
optimization would have made the code slower at least on some
architectures.

But more important, it resulted in build errors on i386 and some other
32bit architectures.

The underlying (and unresolved) issue is that gcc expects libgcc to be
available while the kernel does not link with libgcc on many platforms.

> Pavel

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed



\
 
 \ /
  Last update: 2008-03-10 20:41    [W:0.040 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site