linux-toolchains.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Hongtao Yu <hoy@fb.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Bill Wendling <morbo@google.com>,
	"Jose E. Marchesi" <jemarch@gnu.org>,
	Ruud van der Pas <ruud.vanderpas@oracle.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Vladimir Mezentsev <vladimir.mezentsev@oracle.com>,
	clang-built-linux <llvm@lists.linux.dev>,
	LKML <linux-kernel@vger.kernel.org>, Yonghong Song <yhs@fb.com>,
	Wenlei He <wenlei@fb.com>, Ingo Molnar <mingo@kernel.org>,
	linux-toolchains <linux-toolchains@vger.kernel.org>,
	"elena.zannoni@oracle.com" <elena.zannoni@oracle.com>
Subject: Re: plumbers session on profiling?
Date: Fri, 1 Jul 2022 09:28:47 -0700	[thread overview]
Message-ID: <20220701162847.GS1790663@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <MW3PR15MB3868B1DC443B538A2A27F1D3CFBD9@MW3PR15MB3868.namprd15.prod.outlook.com>

On Fri, Jul 01, 2022 at 03:32:12PM +0000, Hongtao Yu wrote:
> 
> 
> ________________________________
> From: Paul E. McKenney <paulmck@kernel.org>
> Sent: Friday, July 1, 2022 6:50 AM
> To: Peter Zijlstra <peterz@infradead.org>
> Cc: Bill Wendling <morbo@google.com>; Jose E. Marchesi <jemarch@gnu.org>; Ruud van der Pas <ruud.vanderpas@oracle.com>; Nick Desaulniers <ndesaulniers@google.com>; Sami Tolvanen <samitolvanen@google.com>; Vladimir Mezentsev <vladimir.mezentsev@oracle.com>; clang-built-linux <llvm@lists.linux.dev>; LKML <linux-kernel@vger.kernel.org>; Yonghong Song <yhs@fb.com>; Wenlei He <wenlei@fb.com>; Hongtao Yu <hoy@fb.com>; Ingo Molnar <mingo@kernel.org>; linux-toolchains <linux-toolchains@vger.kernel.org>; elena.zannoni@oracle.com <elena.zannoni@oracle.com>
> Subject: Re: plumbers session on profiling?
> 
> On Fri, Jul 01, 2022 at 01:49:06PM +0200, Peter Zijlstra wrote:
> > On Fri, Jul 01, 2022 at 03:17:54AM -0700, Bill Wendling wrote:
> > > On Fri, Jul 1, 2022 at 2:02 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > > >
> > > > On Tue, Jun 28, 2022 at 07:08:48PM +0200, Jose E. Marchesi wrote:
> > > > >
> > > > > [Added linux-toolchains@vger in CC]
> > > > >
> > > > > It would be interesting to have some discussion in the Toolchains track
> > > > > on building the kernel with PGO/FDO.  I have seen a raise on interest on
> > > > > the topic in several companies, but it would make very little sense if
> > > > > no kernel hacker is interested in participating... anybody?
> > > >
> > > > I know there's been a lot of work in this area, but none of it seems to
> > > > have trickled down to be easy enough for me to use it.
> > >
> > > We use an instrumented kernel to collect the data we need. It gives us
> > > the best payoff, because the profiling data is more fine-grained and
> > > accurate. (PGO does much more than make inlining decisions.)
> > >
> > > If I recall correctly, you previously suggested using sampling data.
> > > (Correct?) Is there a document or article that outlines that process?
> >
> > IIRC Google has LBR sample driven PGO somewhere as well. ISTR that being
> > the whole motivation for that gruesome Zen3 BRS hack.
> >
> > Google got me this: https://research.google.com/pubs/archive/45290.pdf
> 
> > Whatever else, please refrain from using PGO and friends to drive
> data-value speculation!
> 
>  Is there a particular reason for this?

Yes, there is.

Doing so breaks many concurrent algorithms.

Sure, the hardware can get away with this sort of thing.  But that is
only because it has access to cache and store-buffer state that allows it
to roll back and replay when needed.  The compiler does not have access
to this state [1], so it needs to avoid playing this game.

							Thanx, Paul

  parent reply	other threads:[~2022-07-01 16:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKwvOdkyY9rsH3eViMK-_4iz_W_usumz5nD+3AhbNCVQ3FRCjA@mail.gmail.com>
     [not found] ` <CAKwvOdnsZekEM77axBf67MDqQVP0n6PTKH=njSyPSWTNiWAOiA@mail.gmail.com>
     [not found]   ` <87mtf7z0rt.fsf@gnu.org>
     [not found]     ` <6F9E9D93-3913-4022-9384-D809C8EF7715@oracle.com>
     [not found]       ` <CAKwvOdm=_YqBpuBzouqoWHYNe6MMUE10vqF0PUkU=hcOj+UqrQ@mail.gmail.com>
     [not found]         ` <B0A01DE7-1B50-479A-92DF-DAFAB3F06E0F@oracle.com>
2022-06-28 17:08           ` plumbers session on profiling? Jose E. Marchesi
2022-06-29 19:48             ` Bill Wendling
2022-07-01  9:01             ` Peter Zijlstra
2022-07-01 10:17               ` Bill Wendling
2022-07-01 11:49                 ` Peter Zijlstra
2022-07-01 13:50                   ` Paul E. McKenney
     [not found]                     ` <MW3PR15MB3868B1DC443B538A2A27F1D3CFBD9@MW3PR15MB3868.namprd15.prod.outlook.com>
2022-07-01 16:28                       ` Paul E. McKenney [this message]
2022-07-01 18:57                   ` Bill Wendling
2022-07-01 19:34                     ` Fangrui Song
2022-07-04 14:03                       ` Peter Zijlstra
2022-07-04 14:01                     ` Peter Zijlstra
2022-07-05 12:57                       ` Peter Zijlstra

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=20220701162847.GS1790663@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=elena.zannoni@oracle.com \
    --cc=hoy@fb.com \
    --cc=jemarch@gnu.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@kernel.org \
    --cc=morbo@google.com \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=ruud.vanderpas@oracle.com \
    --cc=samitolvanen@google.com \
    --cc=vladimir.mezentsev@oracle.com \
    --cc=wenlei@fb.com \
    --cc=yhs@fb.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).