Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1314747pxb; Thu, 28 Jan 2021 13:14:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxpFL5B/5UMoVD2HEgTtPSMvyR+ysi1cg8r3kVXNBcGPb+n1w3WxX/YXOs3eDEiyZplbws X-Received: by 2002:a17:906:a1c2:: with SMTP id bx2mr1440736ejb.138.1611868443089; Thu, 28 Jan 2021 13:14:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611868443; cv=none; d=google.com; s=arc-20160816; b=G/lEs6OgZcpoJr+O40gijerH0IDX9/FSat3YBqEuA7zeFZ6/Xp8cTguPRMFHcmlbaU tEAl98MytV817xqa3qkdkjtplWgzqx5XvUEnSl8SHQccLw1dcXbLrv9a1ZpNmdJd5/Tv y8kxy6CdkBnDRl/YXGBgPjkGkE/c70b4Smsm+ivmpAKu3iDISWdm9j8hXFMeMky+Jf0C sEXIb1Ze38ySoWw/efROwBfTj4ekIbD1NPin/6Um2PrSx9dRK7YOzaUnZCh0KTReP7p1 k8nW/5da0Zjc6ZfIRFLX1QtkJxH2tQVl4kp/y8VrcAvWB8usNyOdwyyBnOJ18lB392Is WhGw== 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=ShMu7npMsBgX+goAZm1Y3mVWCkhJ62xJJYEjYPKDrdU=; b=BncXyRFRWVLEwxny/VRxK9op2vlmYGbE1FHAZzdGycVfCSjmhGqP/UEIclJhBgk8GF xmGOiri0ZQ2jqmvtllI7ZvHyK7gYC8X5vGYSTtXJJZ+5SPq4yJ8Thv27SduV85f1072I oOOSBITDe3GK5JCE3WUKTZahomsSKHy+WBENRCgv1k9U4F5e3WQnoQRNYfNppDytwUzv rWcBnRkGFV0U7Kr2j/ZmRLPNCRGHh5BcZb8ltzwTLmvN11IcejMjlRTKKV64ahXmXUfb z+YczIkJvdRHfIYhfNJ0XHspY4sATvb28G/0qc7pBhYvnCfSC5vwyEGH7yUOjpTtSYXp nFAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LcVHEujp; 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 bi18si3834236edb.309.2021.01.28.13.13.37; Thu, 28 Jan 2021 13:14:03 -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=LcVHEujp; 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 S231160AbhA1VNF (ORCPT + 99 others); Thu, 28 Jan 2021 16:13:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbhA1VNC (ORCPT ); Thu, 28 Jan 2021 16:13:02 -0500 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CDDDC061574 for ; Thu, 28 Jan 2021 13:12:19 -0800 (PST) Received: by mail-pg1-x536.google.com with SMTP id r38so5116250pgk.13 for ; Thu, 28 Jan 2021 13:12:19 -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=ShMu7npMsBgX+goAZm1Y3mVWCkhJ62xJJYEjYPKDrdU=; b=LcVHEujp7i48aNZYHLcFJ8QklAC3AIgHSsbQlZrkZQ+64grgK+DQvw+eh+88Q+0gVY lzBTDitjgJpHE6HJkY3C7XlxVpKTCRP7IrJ1ZtZg0hePT/88PcBRvPgquw5iHZSgDD/q bMNJECwtroQg8p+/pvUnpejtWE9TZevO0uROVJmRnQzbylehseDOHUOoezA80Whgr7LB tW+0klbeJZXbYQ7tWJ6Oqiq6QMRO2ud9iuHgCaUvPi78saI2TLW679w/Z2Ny/793mScI X+8IqNVSBZSH2YfYDSGUjz1wN6OrQnHeuitKgtkqW9hkWBsAKimgWGMoeH1iwxl3MBKF kiMA== 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=ShMu7npMsBgX+goAZm1Y3mVWCkhJ62xJJYEjYPKDrdU=; b=BorD0hjXpZBf/i1PCk7zJm52OkutQn9itjs7svex+nvD9fPWUlVJ+2DyVDPDzPok6d OMadTmwoCEErvQ7tO9+E8zR1FgtcitkJCElL3VerpBg5fmcfHVZY9LI2uKdTELjV4FwD BUuxaP7DjZJfzth2g/sxoQ22r8UtpLJ61U9XPxACuTPJ+1yLbxhNaqfoPutsNdBYsL2V muQS6LE6YsZGwOvwBI++KYL/7Xn/3tLjsitUQ+fr9KilHDWvibA7zqInWk9Kq1wTwcNR YmzkPEJ+4Nj8sFjZf83Emy5PtcwSuRz3nJKWndtPh/fHQJtsTk2DN8kR1EVI/471idCn +lQw== X-Gm-Message-State: AOAM530JbHHgd1lSIzUAr+GZ5OzNoMPLOhhK8wssYNMzwRZZHV2VqYGF 6OzsW02G7lNN+Ml+91l+x3tX+8KNPm/qUZrCpsAT3w== X-Received: by 2002:a63:7e10:: with SMTP id z16mr1266474pgc.263.1611868338941; Thu, 28 Jan 2021 13:12:18 -0800 (PST) MIME-Version: 1.0 References: <20210121082451.2240540-1-morbo@google.com> <20210122101156.3257143-1-morbo@google.com> In-Reply-To: From: Nick Desaulniers Date: Thu, 28 Jan 2021 13:12:06 -0800 Message-ID: Subject: Re: [PATCH v7] pgo: add clang's Profile Guided Optimization infrastructure To: Sedat Dilek Cc: Bill Wendling , Andrew Morton , Jonathan Corbet , Masahiro Yamada , Linux Doc Mailing List , LKML , Linux Kbuild mailing list , clang-built-linux , Nathan Chancellor , Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 28, 2021 at 12:46 PM Sedat Dilek wrote: > > [ LLVM ] > > Today, I switched over to LLVM version 12.0.0-rc1. > > > [ Step #1: 5.11.0-rc5-5-amd64-clang12-pgo ] > > My first kernel was built with CONFIG_PGO_CLANG=y and LLVM=1 plus LLVM_IAS=1. > > [ start-build_5.11.0-rc5-5-amd64-clang12-pgo.txt ] > dileks 193090 193065 0 06:54 pts/2 00:00:00 /usr/bin/perf_5.10 > stat make V=1 -j4 HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld CC=clang > LD=ld.lld LLVM=1 LLVM_IAS=1 PAHOLE=/opt/pahole/bin/pahole > LOCALVERSION=-5-amd64-clang12-pgo KBUILD_VERBOSE=1 > KBUILD_BUILD_HOST=iniza KBUILD_BUILD_USER=sedat.dilek@gmail.com > KBUILD_BUILD_TIMESTAMP=2021-01-28 bindeb-pkg > KDEB_PKGVERSION=5.11.0~rc5-5~bullseye+dileks1 > > Config: config-5.11.0-rc5-5-amd64-clang12-pgo > > > [ Step #2: x86-64 defconfig & vmlinux.profdata ] > > Booted into 5.11.0-rc5-5-amd64-clang12-pgo and built an x86-64 > defconfig to generate/merge a vmlinux.profdata file. > > [ start-build_x86-64-defconfig.txt ] > dileks 18430 15640 0 11:15 pts/2 00:00:00 make V=1 -j4 > HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld CC=clang LD=ld.lld LLVM=1 > LLVM_IAS=1 > > Script: profile_clang-pgo.sh > Config: dot-config.x86-64-defconfig > > > [ Step #3.1: 5.11.0-rc5-6-amd64-clang12-pgo & GNU-AS ] > > The first rebuild with CONFIG_PGO_CLANG=n and "LLVM=1 > KCFLAGS=-fprofile-use=vmlinux.profdata". > I was able to boot into this one. > Used assembler: GNU-AS 2.35.1 > > [ start-build_5.11.0-rc5-6-amd64-clang12-pgo.txt ] > dileks 65734 65709 0 11:54 pts/2 00:00:00 /usr/bin/perf_5.10 > stat make V=1 -j4 HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld CC=clang > LD=ld.lld PAHOLE=/opt/pahole/bin/pahole > LOCALVERSION=-6-amd64-clang12-pgo KBUILD_VERBOSE=1 > KBUILD_BUILD_HOST=iniza KBUILD_BUILD_USER=sedat.dilek@gmail.com > KBUILD_BUILD_TIMESTAMP=2021-01-28 bindeb-pkg > KDEB_PKGVERSION=5.11.0~rc5-6~bullseye+dileks1 LLVM=1 > KCFLAGS=-fprofile-use=vmlinux.profdata > > Config: config-5.11.0-rc5-6-amd64-clang12-pgo > > > [ Step #3.2: 5.11.0-rc5-7-amd64-clang12-pgo & Clang-IAS ] > > The second rebuild with CONFIG_PGO_CLANG=n and "LLVM=1 > KCFLAGS=-fprofile-use=vmlinux.profdata" plus LLVM_IAS=1. > Compilable but NOT bootable in QEMU and on bare metal. > Used assembler: Clang-IAS v12.0.0-rc1 > > [ start-build_5.11.0-rc5-7-amd64-clang12-pgo.txt ] > dileks 6545 6520 0 16:31 pts/2 00:00:00 /usr/bin/perf_5.10 > stat make V=1 -j4 HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld CC=clang > LD=ld.lld PAHOLE=/opt/pahole/bin/pahole > LOCALVERSION=-7-amd64-clang12-pgo KBUILD_VERBOSE=1 > KBUILD_BUILD_HOST=iniza KBUILD_BUILD_USER=sedat.dilek@gmail.com > KBUILD_BUILD_TIMESTAMP=2021-01-28 bindeb-pkg > KDEB_PKGVERSION=5.11.0~rc5-7~bullseye+dileks1 LLVM=1 > KCFLAGS=-fprofile-use=vmlinux.profdata LLVM_IAS=1 > > Config: config-5.11.0-rc5-7-amd64-clang12-pgo > > > [ Conclusion ] > > The only statement I can tell you is a "PGO optimized" rebuild with > LLVM_IAS=1 is compilable but NOT bootable. Thanks for the extensive testing and report. Can you compress, upload, and post a link to your kernel image? I would like to take it for a spin in QEMU and see if I can find what it's doing, then work backwards from there. -- Thanks, ~Nick Desaulniers