linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: William Cohen <wcohen@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	"linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>
Subject: Re: Perf supporting function reordering?
Date: Tue, 18 Mar 2014 00:39:51 +0100	[thread overview]
Message-ID: <20140317233951.GH22728@two.firstfloor.org> (raw)
In-Reply-To: <5327409A.3040309@redhat.com>

On Mon, Mar 17, 2014 at 02:36:10PM -0400, William Cohen wrote:
> On 03/17/2014 12:35 PM, Andi Kleen wrote:
> > William Cohen <wcohen@redhat.com> writes:
> > 
> >> Has there been any thought about perf supporting function reordering? 
> > 
> > See autofdo http://gcc.gnu.org/wiki/AutoFDO and
> > http://gcc.gnu.org/ml/gcc-patches/2011-09/msg01440.html
> > 
> > It's not in any standard compiler unfortunately.
> > 
> > Standard gcc can do it with profile feedback, but not for the standard kernel.
> 
> You mean GCC's "-freorder-functions"? That is rather coarse.  According to the link below it only groups functions into hot and cold sections.

No the IPA passes group the whole program by the global callgraph
(either per unit or globally with LTO)
It also has special support for grouping C++ constructors.

> 
> For the kernel code demand paging and iTLB misses are less of an issue.  Is modules code loaded into hugepages or do they use normal sized pages?  If the modules are using normal sized pages, then wouldn't some of the large modules (for example kvm, i915 and nouveau) benefit from function reordering?


Today the modules use small pages.
Some 2.4 kernels put them actually into the direct (2MB) mapping.
That could be done again.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

      reply	other threads:[~2014-03-17 23:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 16:22 Perf supporting function reordering? William Cohen
2014-03-17 16:35 ` Andi Kleen
2014-03-17 18:36   ` William Cohen
2014-03-17 23:39     ` Andi Kleen [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=20140317233951.GH22728@two.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=wcohen@redhat.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;
as well as URLs for NNTP newsgroup(s).