Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp714261pxb; Wed, 20 Jan 2021 19:40:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6HHOY9owxkH7gV1d77GDcaoX8/wPAN5efEfO2Z+5ss6UqKLnP/STR35KKHpuk0KUJ1YuQ X-Received: by 2002:a17:907:1b27:: with SMTP id mp39mr7867464ejc.519.1611200458064; Wed, 20 Jan 2021 19:40:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611200458; cv=none; d=google.com; s=arc-20160816; b=ZrxHH2Q+YJE0pLCccRx0Y42xtbKSw1bMVZ8+09sRAQhM3Wy8F3V4fSoyNJQ4Fa742J GS//ZkMF220RmDdGmaASRCOgTmH1y/mMROEFZ3zncMVw9gDWcLAC3rQkTTvEf2TX2brD aZNwuqIfc5Zvv8pchjSjBx9/wIsw7sNqD8v9qHebz2B6UyLw4wToqyAdaIV/zzunYtMw ShQJQOausFyFtRubyuzKA+D0/OgMFqI058wB+AgkO0EhDvl32vkKyJBlUiQ619K7MbBd aHxAP0glCYxq228zIBRtL+WPkUp51f9F3ubBQwWVLnittvHyorOwckxvXLj0yKDq5aPL OdkA== 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:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=UQ1sOWJk4CRc1VRTEUkbh3QAItciVZ4tLwnuC/1/JiU=; b=jbBGB3ZByS47lqhk9YgBAil7oSA2k0p6XX45zeY2GJlInYsMzDEVSqZAjGdHLlIrnN nCCO8eoEFPbI+43jKKxPr0ZikFP9d6S2RMFRrY9BgH5N8+/hfN/m+8tUaM45X11VDKtK ZfQ9lndQNrM1Y2hYc0Oj3BJ/GS1XazEi/v6S9CqsIiHOiYVdz3sqe2fot79Bca8hZQw+ rn+UqPj0uHbebF6AT+YfOm/4v8mXgiB1b+4mksHPNmHBU+VjAWsFr1EljGh0HVBitWJV aiFUfWfdW1P+KXPElA9yCzdVR8AjEmUTnxwxMY/u0VqsB7OmR3jtcNb/GMVGAYG01aNm JK0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Bq+t2V2a; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb1si794556edb.432.2021.01.20.19.40.34; Wed, 20 Jan 2021 19:40:58 -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=@gmail.com header.s=20161025 header.b=Bq+t2V2a; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731975AbhAUDFM (ORCPT + 99 others); Wed, 20 Jan 2021 22:05:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728511AbhAUCE1 (ORCPT ); Wed, 20 Jan 2021 21:04:27 -0500 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36919C061575; Wed, 20 Jan 2021 18:03:28 -0800 (PST) Received: by mail-io1-xd36.google.com with SMTP id n2so1031593iom.7; Wed, 20 Jan 2021 18:03:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=UQ1sOWJk4CRc1VRTEUkbh3QAItciVZ4tLwnuC/1/JiU=; b=Bq+t2V2aAIe3czwI6nQ+U3PmrrmP0lwIAU0m9eHsoPYFMFoa5mkZ+/DSCWbE1xONu1 bR+ns1Jx/M9uzBeQX8R8/SqBf8l0WlB/q+NZSya8tXn8hHqYJIu8xY9e5tvHTDRJk+AZ D/MH8cKiQmLcPHkpRrEah5lyAFlyLc3pdBus5Y8HR+Qk6wb6yPWfX6PlISJfQdEVilmq YMViA6XtMUHTukyQL9Rdgy2FbSh2ekilhnaRd4qlEZ+TGAWmzmdIIXy+VexdQAE1WXzb LXkPhWOKcsudK3XJAKgQCoJ9872walj+OWq52DWV7j9M4o2QLodpbbaRDwTvXbq9iwGl o7yQ== 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:reply-to :from:date:message-id:subject:to:cc; bh=UQ1sOWJk4CRc1VRTEUkbh3QAItciVZ4tLwnuC/1/JiU=; b=JttPXBUwAjUNq6HPu24D28LQhI2ppkjIo9Cg3GRx+w5XmL8iNV+2dnAMlDQ3xBYEgE pU2D+1M3oaEVujkhKd1ublxg2v1clf3vSUa3/VorY2ztu94Gmq+Gs3vRVg9q499JVE0+ B/BhKIyklpq1wAaGkjgNyUH+Y8KoFCd6qS4U+IK+r0PuMVUl6x+us5M+eX8dIpnpum3v frRBq3dTy7TwPYISLeAwF4RQQAkhIr/nTzgr7HcoQhCYKGPHEMpIrT1ld38gRZhvOidD IcXcrIHrJnHJVBC31iiMpVjKWQ0VRG6JmPvmIHBxKJhCqua00G895VgXTj9bV2gEPAfp aO+g== X-Gm-Message-State: AOAM532mx9QPVDT5vROMwoX55JhvUkothrWwHboYfEEx8iS60DBLZ9vv WtKxtI1GlWlRboo7OW3e1UMM+zrSMLP5YcPxCqE= X-Received: by 2002:a05:6e02:d0:: with SMTP id r16mr10371308ilq.112.1611194607275; Wed, 20 Jan 2021 18:03:27 -0800 (PST) MIME-Version: 1.0 References: <20210113061958.886723-1-morbo@google.com> <20210116094357.3620352-1-morbo@google.com> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Thu, 21 Jan 2021 03:03:15 +0100 Message-ID: Subject: Re: [PATCH v5] pgo: add clang's Profile Guided Optimization infrastructure To: Bill Wendling Cc: Jonathan Corbet , Masahiro Yamada , Linux Doc Mailing List , LKML , Linux Kbuild mailing list , Clang-Built-Linux ML , Andrew Morton , Nathan Chancellor , Nick Desaulniers , Sami Tolvanen , Fangrui Song Content-Type: multipart/mixed; boundary="0000000000003b46d105b95f7a76" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000003b46d105b95f7a76 Content-Type: text/plain; charset="UTF-8" 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? Thanks. - Sedat - > > Can you give me a LLVM commit-id where you had success with LLVM_IAS=1 > > and especially CONFIG_DEBUG_INFO_DWARF5=y? > > Success means I was able to boot in QEMU and/or bare metal. > > > The DWARF5 patch isn't in yet, so I don't want to rely upon it too much. > > -bw --0000000000003b46d105b95f7a76 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-pgo-Allow-to-use-clang-v11.0.1.patch" Content-Disposition: attachment; filename="0001-pgo-Allow-to-use-clang-v11.0.1.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: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