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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 A6455C48BE5 for ; Sat, 12 Jun 2021 19:29:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86EBF610F8 for ; Sat, 12 Jun 2021 19:29:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231494AbhFLTbA (ORCPT ); Sat, 12 Jun 2021 15:31:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230186AbhFLTa7 (ORCPT ); Sat, 12 Jun 2021 15:30:59 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22CEBC061574 for ; Sat, 12 Jun 2021 12:28:46 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id ce15so9658230ejb.4 for ; Sat, 12 Jun 2021 12:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HEcAR/YBJ4tG1SxjPx2PGfcPs966hhlEtWLnEUkitOw=; b=HdUb91RPhEPJn0AJi54CADEH5e99znvd/HCzRmxFCRbHbQDIw3t38RjLP4AOTuXpq7 eBeiUhPOuAFvGEBupIMtag9pb0dDxuiLm9Qzp3ITDBh8hFpCgFSur0hinT/UKDQxTgeu n34Ukzr/vq2pOpY7y33jg18lWLWn/6Zj3sjUqd0QbXWgi4iVe12T8TxrVcoqyTbB/x3Z 3Hc6GqbQ/VCTjYfVsxPAPkiNWfsD7SzUMH87LTDE6Ho9Xb59Yri9CBLcmFeDTron1wWF FqP/s1ldrZ19a6IkoMnl2wuvpTZKQk2MeqOnBOHowLu8TxvuIu869lUTxVN8zoptLPSa DZXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HEcAR/YBJ4tG1SxjPx2PGfcPs966hhlEtWLnEUkitOw=; b=dQWTMnJt7MGEqJDs+r04lKJGI+EhfCNEpcmsg+cQ1vDLm7qrZ+wL/RhapblpiLtox1 LPnZuMX21hEyFrnLpHQzsZVbmf2FJFxWdSRbEyuI3znvN7YOYl54XW7zVUZHoryA/YbF 8TK24w9t7fl8nwQ8KPPZt1VaTAwdxuk1Q64LNesve4/MGwCW4rikDN8gRrWKFLWo7VNh 3NzVb/abY5RJgK2eCgoM8mxNnXsghuzgH4Q1VQUY2baqtpumjRbDxiUlJbQnhhT5gMSG J4UeLxGnLkt0BD/Zm389jA4mqbkaWzRz8yNAWfTXVnl2HggZ/IWbjcIOH8GIFqAh2ND0 UpAA== X-Gm-Message-State: AOAM530nY+PETqkZBfjh9A8RPSbk2wXAbydTuAmfQFlBtefame4a9rkB DyHhpD1XhuCvzXPElm0Bz03li03W+HFYb2Bq4Hq+ X-Google-Smtp-Source: ABdhPJxP1ZoP/KXjCt4Svz+0ucDKjT/tA+5Q+aPsUCqfc19pDRdSbymlxJjQnjgiodRIo08pom1+mXIyfuqS/4JquBU= X-Received: by 2002:a17:906:1c4d:: with SMTP id l13mr8893522ejg.531.1623526124416; Sat, 12 Jun 2021 12:28:44 -0700 (PDT) MIME-Version: 1.0 References: <20210111081821.3041587-1-morbo@google.com> <20210407211704.367039-1-morbo@google.com> In-Reply-To: From: Bill Wendling Date: Sat, 12 Jun 2021 12:28:33 -0700 Message-ID: Subject: Re: [PATCH v9] pgo: add clang's Profile Guided Optimization infrastructure To: Peter Zijlstra , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Cc: 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 , Fangrui Song Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Sat, Jun 12, 2021 at 12:10 PM Bill Wendling wrote: > ")On Sat, Jun 12, 2021 at 11:15 AM Peter Zijlstra wrote: > > On Sat, Jun 12, 2021 at 10:25:57AM -0700, Bill Wendling wrote: > > > On Sat, Jun 12, 2021 at 9:59 AM Peter Zijlstra wrote: > > > > > > > > On Wed, Apr 07, 2021 at 02:17:04PM -0700, Bill Wendling wrote: > > > > > From: Sami Tolvanen > > > > > > > > > > Enable the use of clang's Profile-Guided Optimization[1]. To generate a > > > > > profile, the kernel is instrumented with PGO counters, a representative > > > > > workload is run, and the raw profile data is collected from > > > > > /sys/kernel/debug/pgo/profraw. > > > > > > > > > > The raw profile data must be processed by clang's "llvm-profdata" tool > > > > > before it can be used during recompilation: > > > > > > > > > > $ cp /sys/kernel/debug/pgo/profraw vmlinux.profraw > > > > > $ llvm-profdata merge --output=vmlinux.profdata vmlinux.profraw > > > > > > > > > > Multiple raw profiles may be merged during this step. > > > > > > > > > > The data can now be used by the compiler: > > > > > > > > > > $ make LLVM=1 KCFLAGS=-fprofile-use=vmlinux.profdata ... > > > > > > > > > > This initial submission is restricted to x86, as that's the platform we > > > > > know works. This restriction can be lifted once other platforms have > > > > > been verified to work with PGO. > > > > > > > > *sigh*, and not a single x86 person on Cc, how nice :-/ > > > > > > > This tool is generic and, despite the fact that it's first enabled for > > > x86, it contains no x86-specific code. The reason we're restricting it > > > to x86 is because it's the platform we tested on. > > > > You're modifying a lot of x86 files, you don't think it's good to let us > > know? Worse, afaict this -fprofile-generate changes code generation, > > and we definitely want to know about that. > > > I got the list of people to add from the scripts/get_maintainer.pl. > The files you list below are mostly changes in Makefile, so it added > the kbuild maintainers and list. There's a small change to the linker > script to add the clang PGO data section, which is defined in > "include/asm-generic/vmlinux.lds.h". Using the "kernel/gcov" initial > implementation as a guildlline > (2521f2c228ad750701ba4702484e31d876dbc386), there's one intel people > CC'ed, but he didn't sign off on it. These patches were available for > review for months now, and posted to all of the lists and CC'ed to the > people from scripts/get_maintainers.pl. Perhaps that program should be > improved? > Correction: I see now that it lists X86 maintainers. That was somehow missed in my initial submission. Sorry about that. Please add any reviewers you think are necessary. -bw