public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Adrian Bunk <bunk@kernel.org>,
	Alexey Starikovskiy <aystarik@gmail.com>,
	lenb@kernel.org, astarikovskiy@suse.de,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Arjan van de Ven <arjan@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [patch] x86: phase out forced inlining
Date: Tue, 4 Mar 2008 17:46:05 +0100	[thread overview]
Message-ID: <20080304164605.GA16379@elte.hu> (raw)
In-Reply-To: <20080303145623.GA25697@uranus.ravnborg.org>


* Sam Ravnborg <sam@ravnborg.org> wrote:

> > Subject: x86: phase out forced inlining
> 
> Any particular reason you made the patch x86 specific?

to keep it simple for now. Some of the other 24 architectures are 
seriously under-tested and while we can make sure x86 works well, i dont 
test the others. If it works out fine on x86 it can be generalized.

> > +config OPTIMIZE_INLINING
> 
> Other (not all) config options that deal with gcc behaviour are named 
> CC_*. But they mostly impact gcc options. CC_OPTIMIZE_INLINING would 
> match the naming of CC_OPTIMIZE_SIZE, except in the latter OPTIMIZE 
> refer to the -O option.
> 
> CC_DEFAULT_INLINE may give the right associations?

i really wanted to name it 'optimize' - because that's what it does. We 
just lost 2 years of uninlining advantage due to CONFIG_FORCED_INLINING 
not working and nobody actually connecting the dots that the lack of 
'forced inlining' should have resulted in a 'smaller image' and report 
it as a bug.

> > + test gcc for this.
> 
> Would it be worth here to mention that stuff that really needs 
> inlining should use __always_inle and not inline?

i think people know that, but i'll add it.

> > + */
> > +#ifndef CONFIG_OPTIMIZE_INLINING
> > +# define inline		inline		__attribute__((always_inline))
> > +# define __inline__	__inline__	__attribute__((always_inline))
> > +# define __inline	__inline	__attribute__((always_inline))
> > +#endif
> 
> A quick google did not tell me the difference between inline, 
> __inline, __inline__. But it turned out the december 2005 thread where 
> there was a lenghty discussion about trusting gcc with respect to 
> inlining. It is not the subject of this patch but I just wondered why 
> we need all these variants.

i dont know why they there are so many variants, but all of them seem to 
be used throughout the kernel:

   inline    : 25648
 __inline__  : 1380
 __inline    : 368

so obviously the patch has to cover them.

a few stats about inlines btw:

- in v2.6.24 there were 26452 inlines in the kernel in 8083114 lines of 
  code - or one inline per 305.6 lines of code.

- in v2.6.25-rc3 there are 27396 inlines in the kernel in 8387992 lines 
  of code - or one inline per 308.2 lines of code.

at that rate, all inlines will be removed in about 117.5 kernel cycles - 
which, if we count with 90 day release cycles, will be finished in about 
29 years.

if we only look at include/linux/ files [which have the largest inlining 
effect], the rate of inline removal is in fact negative: in v2.6.24 we 
had one inline per 59.1 lines, in 2.6.25-to-be we have one inline per 
57.9 lines.

so i'm not holding my breath and i'm going for the much more immediate 
benefit of CONFIG_OPTIMIZE_INLINING=y.

	Ingo

  reply	other threads:[~2008-03-04 16:46 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-01 16:19 [2.6 patch] acpi/battery.c: make 2 functions static Adrian Bunk
2008-03-01 18:26 ` Alexey Starikovskiy
2008-03-01 18:35   ` Adrian Bunk
2008-03-01 18:42     ` Alexey Starikovskiy
2008-03-01 18:45       ` Adrian Bunk
2008-03-03  8:57     ` Ingo Molnar
2008-03-03  9:13       ` Adrian Bunk
2008-03-03  9:17         ` Ingo Molnar
2008-03-03  9:31           ` Sam Ravnborg
2008-03-03  9:48             ` Adrian Bunk
2008-03-03 10:39             ` Ingo Molnar
2008-03-03 11:34               ` Adrian Bunk
2008-03-03 11:45                 ` Ingo Molnar
2008-03-03 12:02                   ` Adrian Bunk
2008-03-03 12:10                     ` Ingo Molnar
2008-03-03 12:29                       ` Adrian Bunk
2008-03-03 12:50                         ` Ingo Molnar
2008-03-03 14:54                           ` Adrian Bunk
2008-03-03 15:01                             ` Adrian Bunk
2008-03-04 13:16                             ` Ingo Molnar
2008-03-04 13:47                               ` Adrian Bunk
2008-03-04 14:22                                 ` Ingo Molnar
2008-03-04 14:36                                   ` Jörn Engel
2008-03-04 14:45                                     ` Ingo Molnar
2008-03-03 12:13                   ` [patch] x86: phase out forced inlining Ingo Molnar
2008-03-03 14:56                     ` Sam Ravnborg
2008-03-04 16:46                       ` Ingo Molnar [this message]
2008-03-04 18:07                         ` Harvey Harrison
2008-03-04 18:09                           ` H. Peter Anvin
2008-03-04 18:14                             ` Harvey Harrison
2008-03-04 18:18                             ` Harvey Harrison
2008-03-03 15:01                     ` Arjan van de Ven
2008-03-03 15:58                       ` Harvey Harrison
2008-03-04  6:42                     ` Andrew Morton
2008-03-04  7:32                       ` Ingo Molnar
2008-03-04  8:00                         ` Andrew Morton
2008-03-04  9:50                           ` Andi Kleen
2008-03-04  8:03                       ` Sam Ravnborg
2008-03-04  8:38                         ` Andrew Morton
2008-03-03  9:45           ` [2.6 patch] acpi/battery.c: make 2 functions static Adrian Bunk

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=20080304164605.GA16379@elte.hu \
    --to=mingo@elte.hu \
    --cc=arjan@infradead.org \
    --cc=astarikovskiy@suse.de \
    --cc=aystarik@gmail.com \
    --cc=bunk@kernel.org \
    --cc=hpa@zytor.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    /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