[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111216085459.GD4170@elte.hu>
Date: Fri, 16 Dec 2011 09:54:59 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Frédéric Weisbecker <fweisbec@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jan Beulich <JBeulich@...e.com>,
Arjan van de Ven <arjan@...radead.org>,
Alexander van Heukelum <heukelum@...tmail.fm>
Subject: Re: [PATCH] x86: Use -m-omit-leaf-frame-pointer to shrink text size
* Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Fri, 16 Dec 2011 09:19:16 +0100 Ingo Molnar <mingo@...e.hu> wrote:
>
> >
> > This patch turns on -momit-leaf-frame-pointer on x86 builds and
> > thus shrinks .text noticeably. On a defconfig-ish kernel:
> >
> > text data bss dec hex filename
> > 9843902 1935808 3649536 15429246 eb6e7e vmlinux.before
> > 9813764 1935792 3649536 15399092 eaf8b4 vmlinux.after
> >
> > That's 0.3% off text size.
> >
> > The actual win is larger than this percentage suggests: many
> > small, hot helper functions such as find_next_bit(),
> > do_raw_spin_lock() or most of the list_*() functions are leaf
> > functions and are now shorter by 2 instructions.
> >
> > Probably a good chunk of the framepointers related runtime
> > overhead on common workloads is eliminated via this patch, as
> > small leaf functions execute more often than larger parent
> > functions.
> >
> > The call-chains are still intact for quality backtraces and for
> > call-chain profiling (perf record -g), as the backtrace walker
> > can deduct the full backtrace from the RIP of a leaf function
> > and the parent chain.
>
> The only problem I can think of (apart from tickling gcc bugs) is that
> it might break __builtin_return_address(n) for n>0 with frame pointers
> enabled? The only code I can find which does this is
> drivers/isdn/hardware/mISDN/ and ftrace.
Well, AFAICS it won't really 'break' it but behave as if the
leaf function got inlined into the parent function. I think we
can live with that.
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists