Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1591435pxj; Sat, 12 Jun 2021 13:33:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQvhT9rxdSCdt2gW09VroQvzc/5CyfmB5bb3zJr+vKmo+cRm8MXKaHYPEcRMToYi3I4Jgf X-Received: by 2002:a05:6402:1906:: with SMTP id e6mr9853937edz.14.1623529994182; Sat, 12 Jun 2021 13:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623529994; cv=none; d=google.com; s=arc-20160816; b=BNebtDaPmFJDMGOmo7ht65SCxIfSEqe4460V5xsq2fjHa6Wj586NyIXBtgazm9Wwe5 UYCsVXszkVXN64oWyxqc9YS/UVWBg+V82CVoqurOktqwK5NA1ncZ20JDbyh9rMo9wEpf Dx3aK7xvLzgu4q10LrkZa0pxOBSuB1r/TEJ2+U5BcDoU/dZUwvwmFizTipw6mTLgOe4d nJcJT/RcE8IbgV5Q41pB8blqHgQnpIjT5hAeeaLf0eA7GgOSMuwZX3EQrae2wqZL87jK uaSMfFPAQ208ip7cWdVQIDDYKJSWbUX5tg7fImvdtpVTqZSpc3/028eRXhfjM0SHLG7R KqHQ== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=ye0j1hPtMrtorLTQXMFdA47MBQh6LFL8kooJgqW9gwQ=; b=j9ivVUKadSA2y11FcrWgTEhbBRywnZjMOwMnxehRkqTn4NbDPqhKn6uIO3RcYL3/o5 QnOQrzYgbt+pYSCFYigvZqSj9Hsbv6X/bMqiJsxn/cF27HplErVLPO2U2cFCyuGnyg9m Xu9YMYv6UsNAMGvFv0zSh2GhDv8JRZPM/BmJSXLZMxRVOfRKPQ0i9KgNC1Tk10ZZmYz0 Hy/4jJJW8EroFH+7U7KEeAS+QOWAVGuEh8pXiAH6cVFnbMkx3UVghjV4IpyiCQxqOQ6o BrfG9LwIPBsU1lYjqBsA5pNZbEBNDcTUCNFCwh37x0jnAx3+s126b0WeEALs5AxY3p1l mbfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="HqC/lKMB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si7645770ejr.435.2021.06.12.13.32.49; Sat, 12 Jun 2021 13:33:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="HqC/lKMB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbhFLUdt (ORCPT + 99 others); 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-kernel@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.