Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1465227rwi; Mon, 31 Oct 2022 17:20:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5liRFNyqbZQIQGTxbLSFcdH2mXiu9jDNEMhjr6Be732rbD1jQsEh3g3hJHm/LA8KY4r6cW X-Received: by 2002:aa7:cdcf:0:b0:463:56ff:4cf8 with SMTP id h15-20020aa7cdcf000000b0046356ff4cf8mr8692562edw.215.1667262018983; Mon, 31 Oct 2022 17:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667262018; cv=none; d=google.com; s=arc-20160816; b=nIJ2y+iK6ejfHzfS/H+GeXYW42PTz8G64tqlCc/v6nQyJ3ozRUl3tbwf94KYNdvKJG zAydpmZTCBt55NJBxtYpXIGpkyfYUnn/x5m7Mduink0IxgM0jXJpCH8J0Xs+XfhSjKfG Hu4n2RLcFZLHjP8Tj6CPOMQMRC9hg4fxF19wwti6+CA7sGxddiU8S/S0CwNBS7flEFEr iY+TXwk6OodXP8hxiXh3LBOhXpAW8GVq6T5Qo65QrC7mqQMYnCHWE3aLuoEBAPFd9OPu tnDp4UTQtOH8T06Ve8v1P9elepx5z3o9dCkbGmbrYosIll4Q7HbE/dVipd3+neBaUyg3 S4sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SKzTP96UBPazCXiA6JP5vjdhd3B+l1W/QdglRdm2JxA=; b=XNoPp5Odb//jx3hmGHjRr5PQSUjhUkSe+FytfLPcjtN3onCq+ovwz3rcxCqF/tqJzn YKyUoacI3o4ZxS4AK/MpsX/O9WSFzuV3xV3II9cvdGJLIv4YZx26Xlq2KnxKxP4rYzzc azfCwAZKV3XzD7kLhvPQgCs0wlK6IQGky3QQCazeRx1fEu6av6Wt8ivL8Qpd+Y7cbRjv OFL4ewncteGm/pKvUmdX/lLJ4hBZAnXg3EOwK9WqJaJoGlOPrYile+aq2xO5AxwdtAJ7 wo/UyDAcivlXinwV1uSHiM6Y5XtdmYf0x/tsJyuon/wBBkYgSx/lg3cVryDO9HEvDLOZ wN9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=fSs7mNWH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a056402191100b00457205ae2b5si11385028edz.358.2022.10.31.17.19.53; Mon, 31 Oct 2022 17:20:18 -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=@google.com header.s=20210112 header.b=fSs7mNWH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229866AbiJaX4O (ORCPT + 98 others); Mon, 31 Oct 2022 19:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiJaX4L (ORCPT ); Mon, 31 Oct 2022 19:56:11 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0992120A7 for ; Mon, 31 Oct 2022 16:56:09 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id kt23so33294613ejc.7 for ; Mon, 31 Oct 2022 16:56:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SKzTP96UBPazCXiA6JP5vjdhd3B+l1W/QdglRdm2JxA=; b=fSs7mNWHZXqB5sJhn1hvUjWqwVXunj8X/LQVgtTeC+SeBAYfxpBjpufBUGpK81ZwPY S6StyZQUgELEhOECoRb61eSezwyF0+dzhpXUr5m1V+7BS52B7zwSTcXq59esJ6t2DA+V Rzsod0VR3FhdQ5BhTrHvwJmr++yyA05qaGL/D3bVP4ZaW6E/2lIjQjuMbHEcYOt4c11i cQHdEaYZ1UK6mefW6Dd6TAvw6Y3nxbI1YBx6pWGLQ1dPP8kbzRGl2ex46ka8WHXNq4Rd nekY51WTukjD7EQHU9bM0OmEzHd/oOOzSbajOANs+Q725Zyeh6cRxQSqCI32Gz1Pp708 pUMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SKzTP96UBPazCXiA6JP5vjdhd3B+l1W/QdglRdm2JxA=; b=vTcc7PA7aVKU/umvF1dDfYDZ2vOD3wmC3PunKZ+srJ81sltRJRfB6xo4mZEO1pXY6K 25LPfpKPr7KYYVJW+h/ef48/5mMRu7knL3eXBT47UaOA0epewYYXsaZk61Xihs4H4Npk KLtHYa7fXpR6ihTRMIlM/G5MUOmHaeXCkrTmXdzmRtJRjfgQqVEy+wgwNmAcUK2yeMvC EO5iTcLiZCW2lq4usMn/VI4ZeA0hVkOBOrPIJnFIdMqD8yYWhq1g0NFZNRzsWTc8dFae oCjfiiUmgiUuyzIKAY0FErpf3p2/2EVfvN3vBVWHt0mYI4seQO0sDHIN5kFcWFGYPcg8 g/DA== X-Gm-Message-State: ACrzQf1ZAKiu+RtKBdD3KeC1Jhklwt7ywaPLIlyt4Dmn6v0RW1GmDUC8 evga7nC+5v1p17LCEb+OLUhQR419wpbmjcpPv39k X-Received: by 2002:a17:907:9717:b0:78d:9fb4:16dd with SMTP id jg23-20020a170907971700b0078d9fb416ddmr15801465ejc.720.1667260568290; Mon, 31 Oct 2022 16:56:08 -0700 (PDT) MIME-Version: 1.0 References: <202106281231.E99B92BB13@keescook> <202106291311.20AB10D04@keescook> In-Reply-To: From: Bill Wendling Date: Mon, 31 Oct 2022 16:55:51 -0700 Message-ID: Subject: Re: [GIT PULL] Clang feature updates for v5.14-rc1 To: Peter Zijlstra Cc: Linus Torvalds , Kees Cook , Linux Kernel Mailing List , Bill Wendling , Catalin Marinas , clang-built-linux , Fangrui Song , Heiko Carstens , Jarmo Tiitto , Lukas Bulwahn , Mark Rutland , Masahiro Yamada , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Peter Oberparleiter , Sami Tolvanen , Will Deacon Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 2, 2021 at 5:57 AM Peter Zijlstra wrote: > > On Fri, Jul 02, 2021 at 05:46:46AM -0700, Bill Wendling wrote: > > On Tue, Jun 29, 2021 at 2:04 PM Linus Torvalds > > wrote: > > > > > > On Tue, Jun 29, 2021 at 1:44 PM Kees Cook wrote: > > > > > > > > > > And it causes the kernel to be bigger and run slower. > > > > > > > > Right -- that's expected. It's not designed to be the final kernel > > > > someone uses. :) > > > > > > Well, from what I've seen, you actually want to run real loads in > > > production environments for PGO to actually be anything but a bogus > > > "performance benchmarks only" kind of thing. > > > > > The reason we use PGO in this way is because we _cannot_ release a > > kernel into production that hasn't had PGO applied to it. The > > performance of a non-PGO'ed kernel is a non-starter for rollout. We > > try our best to replicate this environment for the benchmarks, which > > is the only sane way to do this. I can't imagine that we're the only > > ones who run up against this chicken-and-egg problem. > > > > For why we don't use sampling, PGO gives a better performance boost > > from an instrumented kernel rather than a sampled profile. I'll work > > on getting statistics to show this. > > I've asked this before; *what* is missing from LBR samples that's > reponsible for the performance gap? For one, it lacks information on function call frequencies, which help inlining. It's also much more coarse-grained than a perf trace. And while a section of code that doesn't show up in a trace sample may not be executed much, changes to it may have cascading effects. Ingo mentioned had some ideas on minimal software LBR PMU functionality. Do you have a link to this discussion? "The right technical solution to integrate the clang-pgo software instrumetnation would be to implement a minimal software-LBR PMU functionality on top of the clang-pgo engine, and use unified perf tooling to process the branch tracing/profiling information. "In the main PGO thread PeterZ made a couple of technical suggestions about how this can be done using the existing hardware LBR interfaces of perf, but we are flexible if the design is sane and are open to improvements." -bw