mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Alan Cox <alan@linux.intel.com>,
	mingo@elte.hu, linux-kernel@vger.kernel.org,
	Sreedhara DS <sreedhara.ds@intel.com>
Subject: Re: [PATCH] IPC driver for Intel Mobile Internet Device (MID) platforms
Date: Thu, 22 Apr 2010 09:41:56 -0400	[thread overview]
Message-ID: <20100422094156.11b0e119.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100422141611.2599ee67@lxorguk.ukuu.org.uk>

On Thu, 22 Apr 2010 14:16:11 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> > > +static inline int busy_loop(void) /* Wait till scu status is busy */
> > > +{
> > > +	u32 status = 0;
> > > +	u32 loop_count = 0;
> > > +
> > > +	status = __raw_readl(IPC_STATUS_REG);
> > > +	while (status & 1) {
> > > +		udelay(1); /* scu processing time is in few u secods */
> > > +		status = __raw_readl(IPC_STATUS_REG);
> > > +		loop_count++;
> > > +		/* break if scu doesn't reset busy bit after huge retry */
> > > +		if (loop_count > 100000)
> > > +			return -ETIMEDOUT;
> 
> > This function has seven-odd callsites and is waaaaaaaay to fat and slow
> > to be inlined.
> 
> Looking at the asm I'm not convinced.

I tried two version of gcc and both of them just refuse to inline
the function anyway.

If the function is changed to __always_inline, gcc will then inline it.

                  text    data     bss     dec     hex filename
inline            6182     960    1680    8822    2276 arch/x86/kernel/intel_scu_ipc.o
__always_inline   6582     928    1760    9270    2436 arch/x86/kernel/intel_scu_ipc.o

I agree with gcc ;)

      reply	other threads:[~2010-04-22 16:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 10:29 Alan Cox
2010-04-21 20:16 ` Andrew Morton
2010-04-21 20:26   ` Alan Cox
2010-04-22 13:16   ` Alan Cox
2010-04-22 13:41     ` Andrew Morton [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=20100422094156.11b0e119.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alan@linux.intel.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sreedhara.ds@intel.com \
    /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