LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [GIT pull] time(r) fixes for .25
Date: Mon, 10 Mar 2008 21:38:04 +0200	[thread overview]
Message-ID: <20080310193804.GB5727@cs181133002.pp.htv.fi> (raw)
In-Reply-To: <20080310164407.GC5040@ucw.cz>

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


      reply	other threads:[~2008-03-10 19:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-09  8:07 Thomas Gleixner
2008-03-10 16:44 ` Pavel Machek
2008-03-10 19:38   ` Adrian Bunk [this message]

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=20080310193804.GB5727@cs181133002.pp.htv.fi \
    --to=bunk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [GIT pull] time(r) fixes for .25' \
    /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

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).