Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp548036iog; Fri, 17 Jun 2022 08:27:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sLXrhoTvDZiP421EdL0KaYd8e6lp+NBPjLTLnPFNfo+YMGuef6BFA//TcJTlSdYulfBYM7 X-Received: by 2002:a17:902:f548:b0:167:5c83:3adb with SMTP id h8-20020a170902f54800b001675c833adbmr10263410plf.70.1655479634396; Fri, 17 Jun 2022 08:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655479634; cv=none; d=google.com; s=arc-20160816; b=cjttLzui1s0YxTB+7vWXHk3IKYBk4vzZ2zvt8KvcURL860XmREHWyG0bOfysj2OLBv aOCELbIt+1EWQzjEj420LEu28RmMOAE/1CxSvgpmJc/j8iJrTgDylPVYIYocEDKlCozj hR0GYIxNaIO8m2KKW2ujm3bE5qB8h97uBwNa0vrzcE3754hI4cBkLV3DpjlqNONxcAmD 5fZ34zVFdTOGjFWtox6ofX9JlCiGThC3b7Eihi+WRi702/A9C13luXsVnhFlGnjEJb2J rwFeKCkRkDtOgvhXxSnKFBYhbbI0VAn6j920MAsR/5a0qhH4WlD8u/aSWrmdEZrq959v HZQQ== 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:dkim-filter; bh=vvgHqTh1wXE7hKhLuY8TbWdkyuEIhZfbEWS5VwgPLWY=; b=VBVe5Sq7xgRrwNDy7SmS8TGdLywcGlcezSglBty/E9zbSs6AArHjDvGITf1ND+vjzM 8O2OV+9JFsQcAr1bczjjXBsJtIUvaiVMibV/tQQ1XHorZ+ESvinwUdQPK0OEKJmY23Xd 3rIbx1Fdz+6PhmGDs9tT0uVz9ReFodT/AIuhxcbiuuj7GcZX3npJGOtX5b6Fo2SRXJHT YGh4VE9DgtQ5lZ6zmJqWJI4UyvXnyUDhHai2bUNzt698qz0sjH0ta6U+wbiRkOOiV72t hj/ZPUVp5wPPlFuZIflnkTJwqOslVAE0zUUyrPNiKncL51oYCJWmTLS81hEq4ZRaKp1T i41g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=cOhw7EC0; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r12-20020a170902ea4c00b0016a0d3b3a57si609444plg.504.2022.06.17.08.26.55; Fri, 17 Jun 2022 08:27:14 -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=@nifty.com header.s=dec2015msa header.b=cOhw7EC0; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382426AbiFQPWn (ORCPT + 99 others); Fri, 17 Jun 2022 11:22:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382444AbiFQPWl (ORCPT ); Fri, 17 Jun 2022 11:22:41 -0400 Received: from conssluserg-04.nifty.com (conssluserg-04.nifty.com [210.131.2.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31DBC1014; Fri, 17 Jun 2022 08:22:37 -0700 (PDT) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 25HFM6XE030155; Sat, 18 Jun 2022 00:22:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 25HFM6XE030155 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1655479327; bh=vvgHqTh1wXE7hKhLuY8TbWdkyuEIhZfbEWS5VwgPLWY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cOhw7EC0b08gudg9umyob1bJwEpW/9gwNi19r2R3h6ee2+O0VOh2ZikmOyg93iBNw 4JApVO9XsOOkgnMMjxCowcJ3hkoCvIjWXEBaccZDpXgoJauYp9TywX0OIjQ2E1tkhp 2MXfPqpc1t41FUF6HuTzyvvskXjjBAKGgmYXIx691NQinh+X15JMOw6CB3cUNOYNnm F7K1xY/eLP0ysPIgbhLFVOzRpv5EIyzfTz1U5Uzwb/Z0W9MkVLHvRAjhKrh1hcMcFg LK/xSRD6xfZUYW2ljpr+0U5pwXhpQwuSNxXE8Hgl+25jN9TcR2gXf3jfm2e4oohwCm ZfUiGipTAAJCg== X-Nifty-SrcIP: [209.85.128.52] Received: by mail-wm1-f52.google.com with SMTP id i81-20020a1c3b54000000b0039c76434147so4549592wma.1; Fri, 17 Jun 2022 08:22:06 -0700 (PDT) X-Gm-Message-State: AOAM531oQaBYN7QPzcs4x2AScm2Q0sm/pwUOYGcemnetMnZfZebfhny2 OeGidtWfNmcMFa3Z0YzAvcjBYrroLnBzVpCHZBY= X-Received: by 2002:a7b:c346:0:b0:397:626d:d2c4 with SMTP id l6-20020a7bc346000000b00397626dd2c4mr21355129wmj.172.1655479325296; Fri, 17 Jun 2022 08:22:05 -0700 (PDT) MIME-Version: 1.0 References: <20220616104541.16289-1-jslaby@suse.cz> In-Reply-To: From: Masahiro Yamada Date: Sat, 18 Jun 2022 00:21:28 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: pass jobserver to cmd_ld_vmlinux.o To: Sedat Dilek Cc: Jiri Slaby , Linux Kbuild mailing list , Linux Kernel Mailing List , Michal Marek , Nick Desaulniers , Nathan Chancellor , Sami Tolvanen , clang-built-linux , Fangrui Song Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL, T_SCC_BODY_TEXT_LINE autolearn=no 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 (+LLVM list, Fangrui Song) On Fri, Jun 17, 2022 at 7:41 PM Sedat Dilek wrote: > > 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 i Hi Jiri, Please let me clarify first. Here, is it OK to assume you are talking about Clang LTO instead of GCC LTO because the latter is not upstreamed ? I tested this patch but I did not see any performance change for Clang LTO. [1] CONFIG_CLANG_LTO_FULL lld always runs sequential. It never runs in parallel even if you pass -j option to Make [2] CONFIG_CLANG_LTO_THIN lld always runs in parallel even if you do not pass -j option In my machine, lld always allocated 12 threads. This is irrespective of the Make parallelisms. One more thing, if a program wants to participate in Make's jobserver, it must parse MAKEFLAGS, and extract file descriptors to be used to communicate to the jobserver. As a code example in the kernel tree, scripts/jobserver-exec parses "MAKEFLAGS" and "--jobserver". I grepped the lld source code, but it does not contain "MAKEFLAGS" or "jobserver". masahiro@oscar:~/ref/lld$ git remote show origin * remote origin Fetch URL: https://github.com/llvm-mirror/lld.git Push URL: https://github.com/llvm-mirror/lld.git HEAD branch: master Remote branches: master tracked release_36 tracked release_37 tracked release_38 tracked release_39 tracked release_40 tracked release_50 tracked release_60 tracked release_70 tracked release_80 tracked release_90 tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (up to date) masahiro@oscar:~/ref/lld$ git grep MAKEFLAGS masahiro@oscar:~/ref/lld$ git grep jobserver So, in my research, LLD does not seem to support the jobserver. If you are talking about GCC LTO, yes, the code tries to parse "--jobserver-auth=" from the MAKEFLAGS environment variable. [1] [1]: https://github.com/gcc-mirror/gcc/blob/releases/gcc-12.1.0/gcc/lto-wrapper.cc#L1341 But, as you may know, GCC LTO works in a different way, at least, we cannot do it before modpost. -- Best Regards Masahiro Yamada