Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp303684iog; Fri, 17 Jun 2022 04:04:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sSQfxIMzQ30uXJY9lreH7Jmfn/SEoN/RmK66wZxa7nTIqVpSKHLarQdNb55faT9QrrMtf7 X-Received: by 2002:a05:6a00:158e:b0:51c:2a89:3845 with SMTP id u14-20020a056a00158e00b0051c2a893845mr9571424pfk.64.1655463862813; Fri, 17 Jun 2022 04:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655463862; cv=none; d=google.com; s=arc-20160816; b=YpJLtXGNKS1IwPE/Aj1Cay/ZE0g6dpOIWU16yoWx1Py4fJSQNWX0H8UGjTuLbaiXEa NuY5U2o+zd3RHUpEydZRUEdXisOLQXfWMfw4NpvyZIm101rWoBnQO7kb491Dz56o1Lfo 9otumpEZYxCw4IhNBF06FBAHcQa2DMNFDZQoj4DO5LACRRnlkSgXe1s9ZaLLIn8ESRSf kTIxEtZW+L+PLDVpPNe6SU4WrBVxS3uTqBjfw1tBjnNYfFYMmWn5JHVKuTXJClznAAwG SpPSeFG1PFXpZt3FOIqNm4/15o97qlXiGSBjVPIrTUPUCaCCiv3gl5N61p0tLJwDttqE 2ATQ== 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=hNvnsHWLfPD5xPDN3K8AjGOxJosoF61E01tr2mE6ML4=; b=qaDcMgBzMz7LeNgYSSeiv+RXbujtcInBM0RVEtkM6kEIjyMy4GQZsXIQ5SgUlq3g4U rp+bJWJ7XMkd6QyPLaoG2ANBbSo4tfl+iy3+7OMhSK0ObpRHCIDRM86jkzQkcj+GHj4E /jjUNPCOHjiySaK65Nuchs37StcnGdpOmm5EcFdwz8WppQEhIKpShKEb2TqEYLm5DFS3 GQ12+4lemwHbQ1awSYVawNSzhe4+qyH96mJwHVbXZHyE4nXNG7MayVch0RiSPQXTWHwO 52Yy1WzIfJ1Ohpo6zTBGLKMLqQAhzb9kXPHvS90x/OZYZoRrRyZXgH/fjTRGML7kl/uR G0ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mxvBY8hn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u22-20020a63ef16000000b003f84816d04fsi6213202pgh.8.2022.06.17.04.04.04; Fri, 17 Jun 2022 04:04:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mxvBY8hn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1381980AbiFQKlw (ORCPT + 99 others); Fri, 17 Jun 2022 06:41:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381847AbiFQKls (ORCPT ); Fri, 17 Jun 2022 06:41:48 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 691006B020; Fri, 17 Jun 2022 03:41:47 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id q11so4119919iod.8; Fri, 17 Jun 2022 03:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=hNvnsHWLfPD5xPDN3K8AjGOxJosoF61E01tr2mE6ML4=; b=mxvBY8hnr2R7JJhQ/6fhF+aItSfMyYliSSHEVT+NEsHpZ8JkDUkGC7aaMxQO8Ozb56 EtWBGwGYH5ZchsuMaT61MViWqT1FDdosAt6g9znU5U8XC4C2eS7aeyJyGhCHK0M6YtoS OZ9IIVR14pFqUxZGx/VJFl1s04gHgx6nBW6wO6AtudgK456sYBmJY7v7Fbjn1hSqKnLS gF22OWtsbj2nf/nPagSK3wvGhyDsv2nxV7vtaqE+I+ZkSx31KZa+RQq30lTXQb7VS2r8 JXgpMsGOZ9a3lt0oDF3iejthclJ7aFA3H4WgTMnCw2IIbctcwbXOnldI/vNyROfTpwYF Hjlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=hNvnsHWLfPD5xPDN3K8AjGOxJosoF61E01tr2mE6ML4=; b=B3lJn69ZR46SQfoFzvvNcJQzKOSNHxpieOvS5wNEaDzC8YN/mqD1BgGeIolK1VVmsD xOEH9QgUHTls54PwkZ+kTRKEvMSgOffn2FQ77YEQusFPgllo+JxMXxqwK01vPNQRIVSW CCut0qYsiX5aObJ/i5z+Yu7FLZglFkWVXayk8yuW4yPtAq/HLwg9UFkDacEdB8x+Mf+e Hpii6Y0Yha4FcLAjbtNCBVHU7UyoqbVchfyTeKBqmoQUoL1x/GiAfpe0QtpvYn3YV1KQ K7CDkvBSZQbnEnGpR0ExN4X9tSbTpWxJFzYhM11Y8fvRBq/U1Hd5QH1GLvalwpFksZU2 W4kw== X-Gm-Message-State: AJIora+7MLormAChVHeJp4OaXTMlnaVck77k4DFQYeQJod1WF/HETehj 8CWVE+ZrIMo5Wl94zK+wcB6pNvm+zw1r2DCK3QxT1ocAL/3DJw== X-Received: by 2002:a05:6638:25c8:b0:332:198c:dbf6 with SMTP id u8-20020a05663825c800b00332198cdbf6mr5020981jat.52.1655462506715; Fri, 17 Jun 2022 03:41:46 -0700 (PDT) MIME-Version: 1.0 References: <20220616104541.16289-1-jslaby@suse.cz> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Fri, 17 Jun 2022 12:41:10 +0200 Message-ID: Subject: Re: [PATCH] kbuild: pass jobserver to cmd_ld_vmlinux.o To: Jiri Slaby Cc: masahiroy@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Marek , Nick Desaulniers , Nathan Chancellor , Sami Tolvanen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 17, 2022 at 12:35 PM Sedat Dilek wrote: > > On Fri, Jun 17, 2022 at 12:53 AM Sedat Dilek wrote: > > > > On Thu, Jun 16, 2022 at 4:09 PM Sedat Dilek wrote: > > > > > > On Thu, Jun 16, 2022 at 12:45 PM Jiri Slaby wrote: > > > > > > > > Until the link-vmlinux.sh split (cf. the commit below), the linker was > > > > run with jobserver set in MAKEFLAGS. After the split, the command in > > > > Makefile.vmlinux_o is not prefixed by "+" anymore, so this information > > > > is lost. > > > > > > > > Restore it as linkers working in parallel (esp. the LTO ones) make a use > > > > of it. > > > > > > > > Cc: Sedat Dilek > > > > Cc: Masahiro Yamada > > > > Cc: Michal Marek > > > > Cc: Nick Desaulniers > > > > Fixes: 5d45950dfbb1 (kbuild: move vmlinux.o link to scripts/Makefile.vmlinux_o) > > > > Signed-off-by: Jiri Slaby > > > > > > Nice catch. > > > ( I have seen some slowdown in my build-time. Will test and report. ) > > > > > > Reviewed-by: Sedat Dilek > > > > > > > No measurable difference in build-time. > > > > Tested-by: Sedat Dilek # LLVM-14 (x86-64) > > > > [ CC Nathan and Sami ] > > I re-checked as my build-time takes approx. 15mins more than usual > with Linux v5.17. > > [ Perf - seconds time elapsed ] > v5.17: approx. 12500 > v5.19: approx. 13500 > > +1.000 secs = +16,67mins > > I am still investigating. > > I use LLVM v14.0.4 and CONFIG_LTO_CLANG_THIN=y. > > When I check for... > > $ egrep 'Makefile.vmlinux_o|jobserver-exec|link-vmlinux.sh' > build-log_5.19.0-rc2-2-amd64-clang14-lto.txt > 61414: sh scripts/link-vmlinux.sh "ld.lld" "-m elf_x86_64 > --thinlto-cache-dir=.thinlto-cache -mllvm -import-instr-limit=5" > "--emit-relocs --discard-none -z max-page-size=0x200000 > --build-id=sha1 -X --orphan-handling=warn"; true > 61426:+ make -f ./scripts/Makefile.vmlinux_o > 61427: python3 ./scripts/jobserver-exec perl > scripts/generate_initcall_order.pl arch/x86/kernel/head_64.o > arch/x86/kernel/head64.o arch/x86/kernel/ebda.o > arch/x86/kernel/platform-quirks.o init/built-in.a usr/built-in.a > arch/x86/built-in.a kernel/built-in.a certs/built-in.a mm/built-in.a > fs/built-in.a ipc/built-in.a security/built-i > n.a crypto/built-in.a block/built-in.a lib/built-in.a > arch/x86/lib/built-in.a lib/lib.a arch/x86/lib/lib.a > drivers/built-in.a sound/built-in.a net/built-in.a virt/buil > t-in.a arch/x86/pci/built-in.a arch/x86/power/built-in.a > arch/x86/video/built-in.a > .tmp_initcalls.lds > 61693:+ echo vmlinux: scripts/link-vmlinux.sh > > Plus vmlinux.o > > 61428: ld.lld -m elf_x86_64 --thinlto-cache-dir=.thinlto-cache -mllvm > -import-instr-limit=5 -r -o vmlinux.o -T .tmp_initcalls.lds > --whole-archive arch/x86/kernel/head_64.o arch/x86/kernel/head64.o > arch/x86/kernel/ebda.o arch/x86/kernel/platform-quirks.o > init/built-in.a usr/built-in.a arch/x86/built-in.a kernel/built-in.a > certs/built-in.a mm/built-in.a fs/built-in.a ipc/built-in.a > security/built-in.a crypto/built-in.a block/built-in.a lib/built-in.a > arch/x86/lib/built-in.a lib/lib.a arch/x86/lib/lib.a > drivers/built-in.a sound/built-in.a net/built-in.a virt/built-in.a > arch/x86/pci/built-in.a arch/x86/power/built-in.a > arch/x86/video/built-in.a --no-whole-archive --start-group > --end-group ; ./tools/objtool/objtool --hacks=jump_label > --hacks=noinstr --mcount --orc --retpoline --static-call > --uaccess --link -- > link vmlinux.o > > Pooh, truncated via Gmail? Attached as a file. > > Checking via ps... > > $ ps -ef | grep l[l]d > lld-jobserver.txt > > ...and top util shows me only one lld link-job is running (file attached). > > Unsure, if in my setup lld linker benefits from jobserver feature or not. > > Am I missing something? > > My kernel-config is attached. > Found this... $ ld.lld-14 --help --thinlto-jobs= Number of ThinLTO jobs. Default to --threads= -Sedat-