Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1567375pxj; Sat, 12 Jun 2021 12:37:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAg0zhp+nCStCwsvBtR1NhvPyAmXY34iKBUtNgIvKQoGJEV9cZYY5wYUZwNGv9qJnINFLz X-Received: by 2002:a17:906:3884:: with SMTP id q4mr8907668ejd.66.1623526675788; Sat, 12 Jun 2021 12:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623526675; cv=none; d=google.com; s=arc-20160816; b=mTwjbJbDjnzNGU76gjKuTB2q6QxbJRYl/+O1VvKpKgx3V1OdaHDV1ft1WKNFJMN9Qo 0DW/8dykQnbEBho/GQKyJUDdxoP5+/y0/EnBYUv8ZVeLO2Uru7fF5N4O3hzJphuN23pj lYwTqEEdAS7l4DOLkaOA/fDxVkkcS3jnDOdm3WPR8nATO9KpPl+eBJovdaYdtnLaishm A9PYt2aRxukNeWGW5Y34YFVsU2pq/IylQjIiRHusP9RUCWyzOMR4k+8H8MqZ5Lm0qtXs nhX19g7OyJcKCDOu7Zo9vGZ8Qji/oCz94Mz61Gu1464s8Bl5AAErW6sgW3cvonF5J4x5 u/ng== 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=HEcAR/YBJ4tG1SxjPx2PGfcPs966hhlEtWLnEUkitOw=; b=rm8F4hr6fE9eRohqGk7uPUHJsBgdn6Bn5uEzmslcHUvi4iQ5pdwPsyuEqGAnE1i/la x0ybBuLrst5Xuz7GfjUByBER8CX+b5hu1Q5aEXRuRTmEFJ1bmKPGKzfYDxw1fOqIwzm9 3FmOjQXers3puCOvCu6rL3xntF+QMhSi6oFzmUbdn/QCHY1TpIXMxT4kwiPaURIsuUqK U7H4RHD9JvHQn8COY85eDkXDVm/4xw+HuDOmcAATFsE8O8m0pj2wdpk3zIeA1omID6U6 38x4mj4YPyyduTNd1ugAlyfCIBVY7Coacy6F31qb0bGgNI4HhSRUgkN/Wt6JbJ8Yp/EB kgeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HdUb91RP; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si7456695ejj.85.2021.06.12.12.37.31; Sat, 12 Jun 2021 12:37:55 -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=@google.com header.s=20161025 header.b=HdUb91RP; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231390AbhFLTaq (ORCPT + 99 others); Sat, 12 Jun 2021 15:30:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231228AbhFLTaq (ORCPT ); Sat, 12 Jun 2021 15:30:46 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34AF2C061767 for ; Sat, 12 Jun 2021 12:28:46 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id g20so9727721ejt.0 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=QZoySare/rozSUK/4s4ZRVSygwZmNfHey69e/7ztPPsNwxYiSOtUApt+FntHt2jJG2 oqH7GSTrOZlPq5xdC8r9e4gDqXik7WEANgZtS62+qneRnSJunXfMawoFYJVYA/j2KMkb t+84pgnUSPEO+gY35EejwkYA2/yqy7P7XfAyYmWqCCen3pjeiorXNM0AvnqeAggOgEo5 I9apzrDg2XTCUt6kJqNemDgL+aUQAFrKVysMujRkaHzkrAVlfPzoS1SJ8BnnqhFESybc GjmwdXGySFhpP6ixMsdXs+n8eqbQVXwK1jC0L5xe8sh2xqC78yNStmbKhea9IQW77FPa C9WA== X-Gm-Message-State: AOAM532XauMZo8E5XDY8w04nnX+rkroA9P6oCF824EeeMi1P/9XDPbYN o6SuGjJ8b4NrWU5wt2KQjCBZhZ/MHdKppafK8fKu 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-kernel@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