Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp682683pxb; Thu, 21 Jan 2021 17:56:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3VXy0AlyW9UdcwShICAG4Yy6/UAFY4B5BZdP64E5L/vKGszDe0Qe2/arjMAB7IuuK/Qzt X-Received: by 2002:a17:906:1b0d:: with SMTP id o13mr397440ejg.232.1611280568167; Thu, 21 Jan 2021 17:56:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611280568; cv=none; d=google.com; s=arc-20160816; b=exsp1f1xlXUPnesfe6oaZaBFP7XGGNasA544NFR4rFs2KXTa6VBk0a3BHpIArQagOf y2+IJhZaNOLqb5b8r+SN3g9/yUWv50pHctUmFLhYDPVv+wbCH1q0yljqlDUlejCsZ4iw VWwDpExJGJ+lC9YRkbje0c4c5WzGEZeq+xs862m+ybmK9M3sqPkgiL5kMsDdCyQgXiP4 wnMQsC0vPKEaYF6/X703c4DRzG2rf+elp5GrdvLtgyREn0u2kiq0JhvsjJFi//kewipo o6UpgB0PjaEOZrRtioOu38UhQ4rGIe9TjInZPp2N1mebMMJMTi+qfX3OmEnfGyHDkloc 9lQg== 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=vf1YWMphq7IfDQQZ2byHu6e71SFyteLzACu9Oza6zmY=; b=0D1n8/hD0F6mroSFwhkJkr5mAnvFIqXdkl9o93bgOuYzaLGdXlpeSSr7WbfuJhLi4s yeaUIqpkmqn7QY1korvibcvT9D6w9AkItmYpzF5WytWdiTB9MeyT8cdwPYel5wMpi/JN u31df9lveNPmylEZR6swE7yxTHvkf34gqxxtyh1SXNCetXxu0M2I/9+SxPPNTkJ8DpE3 wRJotwuVXHdwJxvXSz5rF2MQ+DT/WA5RTLkZW+/itI63fe/3KdxbhOUf3RBejPBvrd1Q 9+dkyZf6OwfhKsi0GEpuizQwq1iIimxVSZtAnuXrHF7xnh01NHjsYAGVJzMr7yvUTUPo Iypw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tb5wF3uX; 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 t16si2948864edi.338.2021.01.21.17.55.44; Thu, 21 Jan 2021 17:56:08 -0800 (PST) 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=tb5wF3uX; 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 S1726367AbhAVBxb (ORCPT + 99 others); Thu, 21 Jan 2021 20:53:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbhAVBx0 (ORCPT ); Thu, 21 Jan 2021 20:53:26 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59FD7C0613D6 for ; Thu, 21 Jan 2021 17:52:46 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id b8so2330953plh.12 for ; Thu, 21 Jan 2021 17:52:46 -0800 (PST) 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=vf1YWMphq7IfDQQZ2byHu6e71SFyteLzACu9Oza6zmY=; b=tb5wF3uXiUdTbE6BLyQLy5kvrs957kxDCHIzkbtPRzumfJR373zp+3Dzh3LUQJrxrr aqJggpQHp0JxZBOMJPoNzW9upIYVz38x+C+Osa8wigYdMjAnI1Sj6EgnArsY4+8xs9mm KIt6OeefkuC1IeslgLSi11/+dHA9h0L1RzkmZ3GAdrNbcVtTHT/NWekbU/1wkU9yZTRE 9aX0TOg/xLP8SwgEhVeIqt4yXlaDb64VrKZpDQl0cPaMPBQ0D2Fxg9KU9CX2mDFzJ9AO ruflRRY7FdksdohDGZgiudasVbrM7YuzneEnFMxPamnmCZsjNzuYCtLd3aXA0NFPT5Nf Dzmw== 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=vf1YWMphq7IfDQQZ2byHu6e71SFyteLzACu9Oza6zmY=; b=m8gn3PrWKWObaf6XlS7aFA2yxtWffAIqv1xG6/7XPjlSTmb5Ei6/6HfDMGmxphsjIO Ceqk2U4O80NB+n1KXwKWyTulR5RvU1BLYXRDjzPsNXagMPE2EpKhJILGOXQLnMHpOSmU CH8zh0iaWmsYzDUd6q/77bYkjei/+TR4p+hEHudjmkJ3OQM0Nu75iEfdQOiaEvO86rD6 QYnM3qK2cwUfIujcyjEacrzICj2U9Blf3dibKQq2hb2Qox1/peXf5ix8KcdLDx3bvHxq n3/YTObSDhkUoHcr7NJZTxTRz+WgfecpNQ2PR4KuUuTRKynu/Cc1eQ7VP/jO2nZ+Dyzr Ig4A== X-Gm-Message-State: AOAM532xfhy6aZtoXgQOxIobqMWmxk+He6p2TnoiWn1OwZ63yHI9jsus MaIEpbUEDt1cbTzHhMSa+u0FkTnC04e1CtzLcz6pBg== X-Received: by 2002:a17:90a:9915:: with SMTP id b21mr2540454pjp.101.1611280365695; Thu, 21 Jan 2021 17:52:45 -0800 (PST) MIME-Version: 1.0 References: <20210113061958.886723-1-morbo@google.com> <20210116094357.3620352-1-morbo@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 21 Jan 2021 17:52:34 -0800 Message-ID: Subject: Re: [PATCH v5] pgo: add clang's Profile Guided Optimization infrastructure To: Sedat Dilek Cc: Bill Wendling , Jonathan Corbet , Masahiro Yamada , Linux Doc Mailing List , LKML , Linux Kbuild mailing list , Clang-Built-Linux ML , Andrew Morton , Nathan Chancellor , Sami Tolvanen , Fangrui Song Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 5:49 PM Sedat Dilek wrote: > > On Fri, Jan 22, 2021 at 2:43 AM Nick Desaulniers > wrote: > > > > On Wed, Jan 20, 2021 at 6:03 PM Sedat Dilek wrote: > > > > > > On Mon, Jan 18, 2021 at 10:56 PM Bill Wendling wrote: > > > > > > > > On Mon, Jan 18, 2021 at 9:26 AM Sedat Dilek wrote: > > > > > > > > > > On Mon, Jan 18, 2021 at 1:39 PM Sedat Dilek wrote: > > > > > > > > > > > > On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling wrote: > > > > > > > > > > > > > > On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek wrote: > > > > > > > > > > > > > > > > [ big snip ] > > > > > > > > > > > > > > [More snippage.] > > > > > > > > > > > > > > > [ CC Fangrui ] > > > > > > > > > > > > > > > > With the attached... > > > > > > > > > > > > > > > > [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for > > > > > > > > undefined symbols > > > > > > > > > > > > > > > > ...I was finally able to boot into a rebuild PGO-optimized Linux-kernel. > > > > > > > > For details see ClangBuiltLinux issue #1250 "Unknown symbol > > > > > > > > _GLOBAL_OFFSET_TABLE_ loading kernel modules". > > > > > > > > > > > > > > > Thanks for confirming that this works with the above patch. > > > > > > > > > > > > > > > @ Bill Nick Sami Nathan > > > > > > > > > > > > > > > > 1, Can you say something of the impact passing "LLVM_IAS=1" to make? > > > > > > > > > > > > > > The integrated assembler and this option are more-or-less orthogonal > > > > > > > to each other. One can still use the GNU assembler with PGO. If you're > > > > > > > having an issue, it may be related to ClangBuiltLinux issue #1250. > > > > > > > > > > > > > > > 2. Can you please try Nick's DWARF v5 support patchset v5 and > > > > > > > > CONFIG_DEBUG_INFO_DWARF5=y (see attachments)? > > > > > > > > > > > > > > > I know Nick did several tests with PGO. He may have looked into it > > > > > > > already, but we can check. > > > > > > > > > > > > > > > > > > > Reproducible. > > > > > > > > > > > > LLVM_IAS=1 + DWARF5 = Not bootable > > > > > > > > > > > > I will try: > > > > > > > > > > > > LLVM_IAS=1 + DWARF4 > > > > > > > > > > > > > > > > I was not able to boot into such a built Linux-kernel. > > > > > > > > > PGO will have no effect on debugging data. If this is an issue with > > > > DWARF, then it's likely orthogonal to the PGO patch. > > > > > > > > > For me worked: DWARF2 and LLVM_IAS=1 *not* set. > > > > > > > > > > Of course, this could be an issue with my system's LLVM/Clang. > > > > > > > > > > Debian clang version > > > > > 12.0.0-++20210115111113+45ef053bd709-1~exp1~20210115101809.3724 > > > > > > > > > Please use the official clang 11.0.1 release > > > > (https://releases.llvm.org/download.html), modifying the > > > > kernel/pgo/Kconfig as I suggested above. The reason we specify clang > > > > 12 for the minimal version is because of an issue that was recently > > > > fixed. > > > > > > > > > > I downgraded to clang-11.1.0-rc1. > > > ( See attachment. ) > > > > > > Doing the first build with PGO enabled plus DWARF5 and LLVM_IAS=1 works. > > > > > > But again after generating vmlinux.profdata and doing the PGO-rebuild > > > - the resulting Linux-kernel does NOT boot in QEMU or on bare metal. > > > With GNU/as I can boot. > > > > > > So this is independent of DWARF v4 or DWARF v5 (LLVM_IAS=1 and DWARF > > > v2 is not allowed). > > > There is something wrong (here) with passing LLVM_IAS=1 to make when > > > doing the PGO-rebuild. > > > > > > Can someone please verify and confirm that the PGO-rebuild with > > > LLVM_IAS=1 boots or boots not? > > > > I was able to build+boot with LLVM_IAS=1 on my personal laptop (no > > dwarf 5, just mainline+v5). > > > > To clarify: > > I can build a PGO-enabled Linux-kernel and boot it. > Afterwards generate a vmlinux.profdata. > In a next step: A rebuild without PGO-Kconfig disabled + LLVM_IAS=1 > does not boot. Does the rebuild produce the hash warnings previously reported? Can you send your .config for this? -- Thanks, ~Nick Desaulniers