From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59591C48BE8 for ; Sat, 12 Jun 2021 20:31:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3611C61164 for ; Sat, 12 Jun 2021 20:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229814AbhFLUdt (ORCPT ); Sat, 12 Jun 2021 16:33:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbhFLUdt (ORCPT ); Sat, 12 Jun 2021 16:33:49 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 251EFC061574; Sat, 12 Jun 2021 13:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ye0j1hPtMrtorLTQXMFdA47MBQh6LFL8kooJgqW9gwQ=; b=HqC/lKMBoCpd1ZvkELLiU4kuAm 3Tm/SoRIgOjRipBJp+C7KuEHPTPboXomY/9VYwbEMC0Lswkx4nrmz/8cevvmaESokL193AV9gR2yZ ray3FMmxUuN1B3I2jagqHlTYvv4YRC2HjaBlntRO2oQ26PmCKI33n02bwX0NC2jqaZ88PV44tYXQE fLf9jG36+43MT4agE4CL97wXpPMT3y2hFt99wt/ilnFXsws9Weh6fRm4r+2gGS2itCV1Kya9mcQ+s /uTI/6vZj73GLqdL2rrvb1uXJoIaWMeNu+FZznEkUnGVgAfi6ZgtKFrMyYpllt+fouZqijf4E3jxs z0xvZSAg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lsAI7-003zTx-Bf; Sat, 12 Jun 2021 20:31:39 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 1C4DF986F3B; Sat, 12 Jun 2021 22:31:38 +0200 (CEST) Date: Sat, 12 Jun 2021 22:31:38 +0200 From: Peter Zijlstra To: Fangrui Song Cc: Bill Wendling , Kees Cook , Jonathan Corbet , Masahiro Yamada , Linux Doc Mailing List , LKML , Linux Kbuild mailing list , clang-built-linux , Andrew Morton , Nathan Chancellor , Nick Desaulniers , Sami Tolvanen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH v9] pgo: add clang's Profile Guided Optimization infrastructure Message-ID: <20210612203138.GH68208@worktop.programming.kicks-ass.net> References: <20210111081821.3041587-1-morbo@google.com> <20210407211704.367039-1-morbo@google.com> <20210612202015.s4743sr6d3lv3lgf@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210612202015.s4743sr6d3lv3lgf@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Sat, Jun 12, 2021 at 01:20:15PM -0700, Fangrui Song wrote: > For applications, I think instrumentation based PGO can be 1%~4% faster > than sample-based PGO (e.g. AutoFDO) on x86. Why? What specifically is missed by sample-based? I thought that LBR augmented samples were very useful for exactly this. > Sample-based PGO has CPU requirement (e.g. Performance Monitoring Unit). > (my gut feeling is that there may be larger gap between instrumentation > based PGO and sample-based PGO for aarch64/ppc64, even though they can > use sample-based PGO.) > Instrumentation based PGO can be ported to more architectures. Every architecture that cares about performance had better have a hardware PMU. Both argh64 and ppc64 have one. > In addition, having an infrastructure for instrumentation based PGO > makes it easy to deploy newer techniques like context-sensitive PGO > (just changed compile options; it doesn't need new source level > annotation). What's this context sensitive stuff you speak of? The link provided earlier is devoid of useful information.