Received: by 2002:ac0:cd04:0:0:0:0:0 with SMTP id w4csp50920imn; Fri, 1 Jul 2022 09:43:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vEMVGaeAQeVXmA4DYb2VcxQcHZvKvbDyoBLNs1aV4YA5BO5Mp//bIZNEe6ldZJTqPIKDgC X-Received: by 2002:a17:907:2d0b:b0:726:ef78:3399 with SMTP id gs11-20020a1709072d0b00b00726ef783399mr15778963ejc.37.1656693796151; Fri, 01 Jul 2022 09:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656693796; cv=none; d=google.com; s=arc-20160816; b=X99S0NFFHItVa0QUFdj69ApZ3bxm7JGzJjBmhdq1NGzhhmKRT5e5/iq5FdGPi+h00x NQS+9V+gfnrc4qBpyfx2V2Avjc14shMj8xkkCmn8zcNHC9scxXENRyv2gDF/WS9kbYuA VKyOnTwMAKNhSdtDLvTIUjpdeFFi2RyqXU43Rj4JCVewCPEpu/e9EVILRRvyK0ocJxBG VPqJGJT19ARaJDDR2CZQZ3Hsf4qxjhUjHR6MEqb1wWF1DKZqJ3+05J3wAnFwkFwHDsiN /5HIKsW7cpH6sDTYxv9E+ln6l6lpD5HduTHXuzqsyLOfx469Np/UsSmZB1chLOePrv19 KQBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=MDLTpAgwfmFWLemKhCGxV9wiMsk8Fy0+iLz/67RMSQU=; b=ztn64bU4GUlVpoSSYcoSkQRO0J4fXOE0g6Yu+2kYglVy7zXQoRjNEdModyNWYq3bc5 THRbh58tdjxB3puhEloGIFT3NuqC45MMznZ01MGpxuBJFUgQLBqcpyWhswd3V8SZytHz cYMTnMsyqnh/Q8Sj9EculWVv4NGZBn/oqZzqLiP1FHr/FVDqUASrcS/1u4iZunxNOFpL BK/mOYDXUtx8SFhGfeccVKuvIvzmtgTRZbAV4uXLz7gMq48KCEBYqAUtMFM+v9Q060ii hmVGSjuJRrV3rMjjXq7lwv8soNa1y0rnLGnB+S+3QkjeGworZDPIJzhwys0qXJZpdqj8 qoxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JtZzSsYz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020a50d6c1000000b0042df786609asi29117441edj.262.2022.07.01.09.42.51; Fri, 01 Jul 2022 09:43:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JtZzSsYz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232500AbiGAQ2w (ORCPT + 99 others); Fri, 1 Jul 2022 12:28:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232459AbiGAQ2u (ORCPT ); Fri, 1 Jul 2022 12:28:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E5D73205B; Fri, 1 Jul 2022 09:28:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C599162573; Fri, 1 Jul 2022 16:28:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21922C341C7; Fri, 1 Jul 2022 16:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656692928; bh=8EPMGYldgRgjjDYLaj6mvfXTi2oreQHR+PEXE+t1tns=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=JtZzSsYzmJedsJFw0B8d8L5oCI5pxc5AqSscDz7QxpPeNFe2cUASx8JDfrtygZyN6 T8kKljVBPkWvHF8M+CVm+bJFVraXDZr8unrSKQE6Oh81HHTqPe1dwkH8tjP1DzXBjg Cox6C9EqtYq+xIjcVMJbpEOruvHJdecNf5AMkVjgDWA9EcZgAV92CBrsqg3ZtRoYFW cFAG71C5CuzCMSno1cq+Oof9SACkiYHCAF68T7ZQoWvIcRnLsG28/hvsRa+4FvxFeX JT50MfQzCZllUm7mjgR5S0EuHAcaZJvAImaAz+ocDBBr8/SbanF1m8LRCAkwcXImE+ jmoV4OZLZbjtg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id C22315C06A1; Fri, 1 Jul 2022 09:28:47 -0700 (PDT) Date: Fri, 1 Jul 2022 09:28:47 -0700 From: "Paul E. McKenney" To: Hongtao Yu Cc: Peter Zijlstra , Bill Wendling , "Jose E. Marchesi" , Ruud van der Pas , Nick Desaulniers , Sami Tolvanen , Vladimir Mezentsev , clang-built-linux , LKML , Yonghong Song , Wenlei He , Ingo Molnar , linux-toolchains , "elena.zannoni@oracle.com" Subject: Re: plumbers session on profiling? Message-ID: <20220701162847.GS1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <87mtf7z0rt.fsf@gnu.org> <6F9E9D93-3913-4022-9384-D809C8EF7715@oracle.com> <878rpgpvfj.fsf@gnu.org> <20220701135028.GN1790663@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 01, 2022 at 03:32:12PM +0000, Hongtao Yu wrote: > > > ________________________________ > From: Paul E. McKenney > Sent: Friday, July 1, 2022 6:50 AM > To: Peter Zijlstra > Cc: Bill Wendling ; Jose E. Marchesi ; Ruud van der Pas ; Nick Desaulniers ; Sami Tolvanen ; Vladimir Mezentsev ; clang-built-linux ; LKML ; Yonghong Song ; Wenlei He ; Hongtao Yu ; Ingo Molnar ; linux-toolchains ; 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 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