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=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 59DDBC433DB for ; Mon, 18 Jan 2021 23:30:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E1AA22EBF for ; Mon, 18 Jan 2021 23:30:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730590AbhARXaQ (ORCPT ); Mon, 18 Jan 2021 18:30:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbhARXaN (ORCPT ); Mon, 18 Jan 2021 18:30:13 -0500 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 754FFC061573; Mon, 18 Jan 2021 15:29:32 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id e22so12357449iog.6; Mon, 18 Jan 2021 15:29:32 -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=r6GhUyjBJryqxkAoJ8s2TX/9ptHi3eesMQhsJFMSBQ8=; b=sMYMSVO4r89wjawMeSRSrqW+MJLWdaohaSAXdRiRWdhv8DAEfAJYPgPw9hO7E/dESJ vu4m7IrOLqv6HH8Q5lEUPgg2+KP/0MrYn0FkoWpDcc0UxX7WzZ+7KXRCZHeSeMew+PTe CWK3OG1f+7yoZWHVGHtmPnCSDqidTtpVkgJfqXFDyb9M73BFMJH6ShN3qtAlj6YwQM2S aTI+VQhenjm+wZIcCOzz9944TwGFx83CrlMbohCFsxraaaGDMv4B7Z6oxF3FyhDsmEuG 6S1Tw+SA+BGC9b3V1Y4pot3U8QmGf1vD9BGdArn0ADBuUsYbD4wPYJHOQkufGQVNf8bV 3acQ== 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=r6GhUyjBJryqxkAoJ8s2TX/9ptHi3eesMQhsJFMSBQ8=; b=C4ApBcKX+MMjirioZP2ELwpOg/srYXpEP03y3UP1IuimkqXJE+T5oWnGkGGxS43riZ pG1IufEhQZMPiyj4pu6qhKKs2uvQLYeo7t+uXYWGQco+W6bPODYhPzFLo1ymGYHB3k/+ ROCZBDTdIfOJ1CkgoR0W1YgPAy5Zp843dK8GZfTB/U8Kj2lmyK60yXcBa/y0z6kpoXS6 b/Ze/KHb6bG/uWwmMgmTWwagYOvpuCnmXHbhlIDRra6iNwDUQg4cH4friE4U1SL7SJFq O04QvRHDRaN+DtPcWG0ejXSGqBqFlLFblVOlrHWdgvnzafgfrZvuZnyJddfizF6DLkoW Rhgw== X-Gm-Message-State: AOAM531CoweGtJJcYUsgZTarDTx1ADZOOqWZVoic4cZc3Y93VPbv87J7 Vx7BxggPvMLWAYDdgyoqYqcReULVLjN27/WjiQ0= X-Google-Smtp-Source: ABdhPJyuCX/ePcfxvkCz+sX4s+ZEGG0u/bp2cI0TpjI908prPnh39uBWji4CyG38aw8IwOeDmOaR7ECXrSoo7GooEfM= X-Received: by 2002:a92:d990:: with SMTP id r16mr1232898iln.10.1611012571781; Mon, 18 Jan 2021 15:29:31 -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: Tue, 19 Jan 2021 00:29:19 +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: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org 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. > > > 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. > That means to build the first PGO-enabled kernel with clang-11 and rebuild in a second step again with the same clang-11. Just FYI: I was able to boot into a Linux-kernel rebuild with *no LLVM_IAS=1* (means use "GNU AS 2.35.1") set and DWARF5 using LLVM=1 from LLVM/Clang-12. - Sedat -