public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: "Martin Liška" <marxin.liska@gmail.com>
Cc: Teresa Johnson <tejohnson@google.com>,
	Jan Hubicka <hubicka@ucw.cz>,
	Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Steven Bosscher <stevenb.gcc@gmail.com>,
	Jeff Law <law@redhat.com>,	Sriraman Tallam <tmsriram@google.com>,
	Rong Xu <xur@google.com>
Subject: Re: [PATCH] Sanitize block partitioning under -freorder-blocks-and-partition
Date: Sun, 11 Aug 2013 17:55:00 -0000	[thread overview]
Message-ID: <20130811175519.GB24026@kam.mff.cuni.cz> (raw)
In-Reply-To: <CAObPJ3NukzZeKiidb-BP7MZr-BeR2uXi=rujNY6uA5QD+Kp+sA@mail.gmail.com>

> Hello,
>    I did a collection of systemtap graphs for GIMP.
> 
> All these graphs were created with enabled LTO, profiling and -O2.
> 
> 1) gimp-reordered.pdf - function are reordered according to my newly
> created profile that utilizes LTO infrastructure
> 2) gimp-no-top-level-reorder.pdf - (GCC rev. 201648) -fno-top-level-reorder
> 3) gimp-top-level-reorder.pdf - (GCC rev. 201648) -ftop-level-reorder

Thanks for the graphs! 
gimp-top-level-reorder seems to be bogus (it shows accesses into dynstr only).

To catch the -fno-reorder-blocks-partition problem, perhaps you can modify
the Martin's linker script to make .text.unlikely section non-executable.
This way it will crash application every time we jump into it.

Honza
> 
> Honza has an idea how to minimize hot text section and I will send new
> graphs for the proposed patch.
> Moreover, I will send graphs for Inkscape which is written in C++.
> 
> Have a nice day,
> Martin
> 
> On 11 August 2013 15:25, Teresa Johnson <tejohnson@google.com> wrote:
> > Cc'ing Rong since he is also working on trying to address the comdat
> > profile issue. Rong, you may need to see an earlier message for more
> > context:
> > http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00558.html
> >
> > Teresa
> >
> > On Sun, Aug 11, 2013 at 5:21 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> >>>
> >>> I see, yes LTO can deal with this better since it has global
> >>> information. In non-LTO mode (including LIPO) we have the issue.
> >>
> >> Either Martin or me will implement merging of the multiple copies at
> >> LTO link time.  This is needed for Martin's code unification patch anyway.
> >>
> >> Theoretically gcov runtime can also have symbol names and cfg checksums of
> >> comdats in the static data and at exit produce buckets based on matching
> >> names+checksums+counter counts, merge all data into in each bucket to one
> >> representative by the existing merging routines and then memcpy them to
> >> all the oriignal copiles.  This way all compilation units will receive same
> >> results.
> >>
> >> I am not very keen about making gcov runtime bigger and more complex than it
> >> needs to be, but having sane profile for comdats seems quite important.
> >> Perhaps, in GNU toolchain, ordered subsections can be used to make linker to
> >> produce ordered list of comdats, so the runtime won't need to do hashing +
> >> lookups.
> >>
> >> Honza
> >>>
> >>> I take it gimp is built with LTO and therefore shouldn't be hitting
> >>> this comdat issue?
> >>>
> >>> Let me do a couple things:
> >>> - port over my comdat inlining fix from the google branch to trunk and
> >>> send it for review. If you or Martin could try it to see if it helps
> >>> with function splitting to avoid the hits from the cold code that
> >>> would be great
> >>> - I'll add some new sanity checking to try to detect non-zero blocks
> >>> in the cold section, or 0 blocks reached by non-zero edges and see if
> >>> I can flush out any problems with my tests or a profiledbootstrap or
> >>> gimp.
> >>> - I'll try building and profiling gimp myself to see if I can
> >>> reproduce the issue with code executing out of the cold section.
> >>>
> >>> Thanks,
> >>> Teresa
> >>>
> >>> >>
> >>> >> Also, can you send me reproduction instructions for gimp? I don't
> >>> >> think I need Martin's patch, but which version of gimp and what is the
> >>> >> equivalent way for me to train it? I have some scripts to generate a
> >>> >> similar type of instruction heat map graph that I have been using to
> >>> >> tune partitioning and function reordering. Essentially it uses linux
> >>> >> perf to sample on instructions_retired and then munge the data in
> >>> >> several ways to produce various stats and graphs. One thing that has
> >>> >> been useful has been to combine the perf data with nm output to
> >>> >> determine which cold functions are being executed at runtime.
> >>> >
> >>> > Martin?
> >>> >
> >>> >>
> >>> >> However, for this to tell me which split cold bbs are being executed I
> >>> >> need to use a patch that Sri sent for review several months back that
> >>> >> gives the split cold section its own name:
> >>> >>   http://gcc.gnu.org/ml/gcc-patches/2013-04/msg01571.html
> >>> >> Steven had some follow up comments that Sri hasn't had a chance to address yet:
> >>> >>   http://gcc.gnu.org/ml/gcc-patches/2013-05/msg00798.html
> >>> >> (cc'ing Sri as we should probably revive this patch soon to address
> >>> >> gdb and other issues with detecting split functions properly)
> >>> >
> >>> > Intresting, I used linker script for this purposes, but that his GNU ld only...
> >>> >
> >>> > Honza
> >>> >>
> >>> >> Thanks!
> >>> >> Teresa
> >>> >>
> >>> >> >
> >>> >> > Honza
> >>> >> >>
> >>> >> >> Thanks,
> >>> >> >> Teresa
> >>> >> >>
> >>> >> >> > I think we are really looking primarily for dead parts of the functions (sanity checks/error handling)
> >>> >> >> > that should not be visited by train run.  We can then see how to make the heuristic more aggressive?
> >>> >> >> >
> >>> >> >> > Honza
> >>> >> >>
> >>> >> >>
> >>> >> >>
> >>> >> >> --
> >>> >> >> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
> >>> >>
> >>> >>
> >>> >>
> >>> >> --
> >>> >> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
> >>>
> >>>
> >>>
> >>> --
> >>> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
> >
> >
> >
> > --
> > Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413


  reply	other threads:[~2013-08-11 17:55 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01 16:32 Teresa Johnson
2013-08-02 11:22 ` Bernhard Reutner-Fischer
2013-08-02 14:51   ` Teresa Johnson
2013-08-02 15:05     ` Jan Hubicka
2013-08-02 23:05       ` Steven Bosscher
2013-08-03  4:53         ` Teresa Johnson
2013-08-03  4:48       ` Teresa Johnson
2013-08-05 13:36         ` Teresa Johnson
2013-08-05 14:11           ` Jan Hubicka
2013-08-05 14:57             ` Teresa Johnson
2013-08-06  3:01               ` Teresa Johnson
     [not found]           ` <20130808222332.GA31755@kam.mff.cuni.cz>
2013-08-08 23:04             ` Teresa Johnson
2013-08-09  9:58               ` Jan Hubicka
2013-08-09 14:38                 ` Teresa Johnson
2013-08-09 15:28                   ` Jan Hubicka
2013-08-09 15:54                     ` Martin Liška
2013-08-09 21:03                       ` Teresa Johnson
2013-08-09 21:02                     ` Teresa Johnson
2013-08-09 22:43                       ` Jan Hubicka
2013-08-11 12:21                       ` Jan Hubicka
2013-08-11 13:25                         ` Teresa Johnson
2013-08-11 15:55                           ` Martin Liška
2013-08-11 17:55                             ` Jan Hubicka [this message]
2013-08-11 21:05                           ` Jan Hubicka
2013-08-17 15:54                       ` Teresa Johnson
2013-08-17 21:02                         ` Jan Hubicka
2013-08-19 13:51                           ` Teresa Johnson
2013-08-19 15:16                             ` Jan Hubicka
2013-08-19 17:48                               ` Teresa Johnson
2013-08-19 19:56                                 ` Martin Liška
2013-08-27 18:12                                 ` Teresa Johnson
2013-08-28 16:59                                   ` Jan Hubicka
2013-08-28 18:35                                     ` Teresa Johnson
2013-08-30  7:17                                       ` Teresa Johnson
2013-08-30  9:16                                         ` Jan Hubicka
2013-08-30 15:13                                           ` Teresa Johnson
2013-08-30 15:28                                             ` Jan Hubicka
2013-08-30 15:54                                               ` Teresa Johnson
2013-08-30 21:56                                             ` Rong Xu
2013-08-31 16:20                                   ` Jan Hubicka
2013-08-31 23:40                                     ` Jan Hubicka
2013-09-24  8:07                                       ` Teresa Johnson
2013-09-24 13:44                                         ` Jan Hubicka
2013-09-24 19:06                                           ` Teresa Johnson
2013-09-26 20:55                                           ` Rong Xu
2013-09-26 22:23                                             ` Jan Hubicka
2013-09-26 22:54                                               ` Rong Xu
2013-09-24 18:28                                         ` Jan Hubicka
2013-09-24 18:51                                           ` Teresa Johnson
2013-09-25 23:10                                             ` Teresa Johnson
2013-09-26  8:44                                               ` Teresa Johnson
2013-09-26 22:26                                             ` Jan Hubicka
2013-09-27 14:50                                               ` Teresa Johnson
2013-09-29 17:34                                                 ` Teresa Johnson
2013-10-02 16:19                                                   ` Jan Hubicka
2013-10-02 17:55                                                     ` Teresa Johnson
2013-10-02 18:10                                                       ` Jan Hubicka
2013-10-03 13:42                                                     ` Teresa Johnson
2013-10-03 23:37                                                       ` Teresa Johnson
2013-10-01 17:36                                             ` Teresa Johnson
2013-08-19 15:34                           ` Teresa Johnson
2013-08-21 15:31                             ` Jan Hubicka

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=20130811175519.GB24026@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=marxin.liska@gmail.com \
    --cc=rep.dot.nop@gmail.com \
    --cc=stevenb.gcc@gmail.com \
    --cc=tejohnson@google.com \
    --cc=tmsriram@google.com \
    --cc=xur@google.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 read-only IMAP folder(s) and NNTP newsgroup(s).