All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: masahiroy@kernel.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Sami Tolvanen <samitolvanen@google.com>
Subject: Re: [PATCH] kbuild: pass jobserver to cmd_ld_vmlinux.o
Date: Fri, 17 Jun 2022 12:41:10 +0200	[thread overview]
Message-ID: <CA+icZUXDGdPrPKUnevt99LUpTRPe=ogqF33uHQRYrQ6Kh-iTAw@mail.gmail.com> (raw)
In-Reply-To: <CA+icZUUSTcrJqZB-gwNYt5objVg1J5+Ous6_hof0_A6eVCM-Kg@mail.gmail.com>

On Fri, Jun 17, 2022 at 12:35 PM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Fri, Jun 17, 2022 at 12:53 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >
> > On Thu, Jun 16, 2022 at 4:09 PM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> > >
> > > On Thu, Jun 16, 2022 at 12:45 PM Jiri Slaby <jslaby@suse.cz> 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 <sedat.dilek@gmail.com>
> > > > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > > > Cc: Michal Marek <michal.lkml@markovi.net>
> > > > Cc: Nick Desaulniers <ndesaulniers@google.com>
> > > > Fixes: 5d45950dfbb1 (kbuild: move vmlinux.o link to scripts/Makefile.vmlinux_o)
> > > > Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> > >
> > > Nice catch.
> > > ( I have seen some slowdown in my build-time. Will test and report. )
> > >
> > > Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
> > >
> >
> > No measurable difference in build-time.
> >
> > Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # 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=<value>  Number of ThinLTO jobs. Default to --threads=

-Sedat-

  reply	other threads:[~2022-06-17 10:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 10:45 [PATCH] kbuild: pass jobserver to cmd_ld_vmlinux.o Jiri Slaby
2022-06-16 14:09 ` Sedat Dilek
2022-06-16 22:53   ` Sedat Dilek
2022-06-17 10:35     ` Sedat Dilek
2022-06-17 10:41       ` Sedat Dilek [this message]
2022-06-17 15:21         ` Masahiro Yamada
2022-06-17 20:05           ` Fangrui Song
2022-06-18  6:13             ` Sedat Dilek
2022-06-17 16:32       ` Nick Desaulniers
2022-06-17 17:50         ` Sedat Dilek
2022-06-17 19:34           ` Nathan Chancellor
2022-06-18  5:57             ` Sedat Dilek
2022-06-21  7:30         ` Jiri Slaby
2022-06-21  8:41           ` Masahiro Yamada
2022-09-20  8:43             ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+icZUXDGdPrPKUnevt99LUpTRPe=ogqF33uHQRYrQ6Kh-iTAw@mail.gmail.com' \
    --to=sedat.dilek@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=samitolvanen@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.