Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2506504pxb; Mon, 18 Jan 2021 21:32:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNtl/xCAy00eRaRtcO9fBnCuIod3+uDJEYy/5ncR7tyG4nP9gPtBNz7wp8WVu6dVk4rqaZ X-Received: by 2002:a50:ef04:: with SMTP id m4mr2027899eds.283.1611034337009; Mon, 18 Jan 2021 21:32:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611034337; cv=none; d=google.com; s=arc-20160816; b=i8i6OHmIGbpkd6kMePNYLgfdrlB6qdb0VnzJBZFG9PY/h267pWCHq8H8fLNAiOg72M q4SWLFv/S40xj4a+86JG366JUkioBqU+GS65/o/4VEaQs/0sm3UKDCgxVvw0y3fTp0X8 XQRqfEGIn+RG5KpZyQQXBfavFiiD612HcNr4E6bujXPRD7xqm4dj7y732+KJkgCmuZJ9 14HU0mATQrFKGywB8iej/mqUCbMWDXzMkaIQgWcZmjuUFowS9EEy/upijIMcZCJN1vh3 o9oJjgJHMZW9VPqfV5s2KWDki4D2uDo+YfVfiX8ukjhVnBBBuUbVgAoht+DnGYJs/3BH gsrg== 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=r6GhUyjBJryqxkAoJ8s2TX/9ptHi3eesMQhsJFMSBQ8=; b=slxVZGM5T+ksvrcVBQ4Df78S0J5j8EJmvZVRAQRufJx+ScLoZgcxB/Qq9xaLRxgLMB z3B62k87+J6wcLI2MCWG+yijqH6RAivLFuBElyqiF/T8vZjM6v3XzzOmSkB504G3HVnv J71umH97XdnmQE4mRWLoWHU5yz7YUgOG7ORoEwMRowtv4vZ1mlOjxLrM1WObyPryOwWP X+p86gs/OwRjfkFHASQjBpwhcEgxFJ0v+aS2ZoYBOz/FJXqeryZOuoVKjCAcE91PmxO8 RWnt2RiI6DAjDQELtzy1SYIFqzUUgUawan9vk5CiZm0zYpfpMROvENjpPMiULqJnyvWv 1n0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sMYMSVO4; 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 eo9si2000948ejc.734.2021.01.18.21.31.53; Mon, 18 Jan 2021 21:32:16 -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=sMYMSVO4; 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 S1731470AbhARXaQ (ORCPT + 99 others); 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-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-kernel@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 -