From: Masahiro Yamada <masahiroy@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: Sami Tolvanen <samitolvanen@google.com>,
Michal Marek <michal.lkml@markovi.net>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kbuild: reuse vmlinux.o in vmlinux_link
Date: Sat, 23 May 2020 03:16:49 +0900 [thread overview]
Message-ID: <CAK7LNAQ1HTTSq-yp0t6Z4V-Z9PHg+O2n=NC89FJJFNQnhaOcSA@mail.gmail.com> (raw)
In-Reply-To: <202005211506.2700F86@keescook>
On Fri, May 22, 2020 at 7:08 AM Kees Cook <keescook@chromium.org> wrote:
>
> On Thu, May 21, 2020 at 01:27:16PM -0700, Sami Tolvanen wrote:
> > Instead of linking all compilation units again each time vmlinux_link is
> > called, reuse vmlinux.o from modpost_link.
> >
> > With x86_64 allyesconfig, vmlinux_link is called three times and reusing
> > vmlinux.o reduces the build time ~38 seconds on my system (59% reduction
> > in the time spent in vmlinux_link).
>
> Nice! Any time savings at final link is a big cumulative win.
>
> > Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
> > ---
> > scripts/link-vmlinux.sh | 5 +----
> > 1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> > index d09ab4afbda4..c6cc4305950c 100755
> > --- a/scripts/link-vmlinux.sh
> > +++ b/scripts/link-vmlinux.sh
> > @@ -77,11 +77,8 @@ vmlinux_link()
> >
> > if [ "${SRCARCH}" != "um" ]; then
> > objects="--whole-archive \
> > - ${KBUILD_VMLINUX_OBJS} \
> > + vmlinux.o \
> > --no-whole-archive \
> > - --start-group \
> > - ${KBUILD_VMLINUX_LIBS} \
> > - --end-group \
> > ${@}"
> >
> > ${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} \
>
> I think the "um" case can be updated as well too, yes?
I agree.
I changed the um part, then ARCH=um build is successful.
> Also, I think the comment above modpost_link() needs to be updated now
> to reflect the nature of how vmlinux.o gets used after this patch.
>
> --
> Kees Cook
--
Best Regards
Masahiro Yamada
next prev parent reply other threads:[~2020-05-22 18:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-21 20:27 [PATCH] kbuild: reuse vmlinux.o in vmlinux_link Sami Tolvanen
2020-05-21 22:08 ` Kees Cook
2020-05-22 18:16 ` Masahiro Yamada [this message]
2020-05-21 22:18 ` Kees Cook
2020-05-22 17:41 ` Masahiro Yamada
2020-05-22 17:44 ` Masahiro Yamada
2020-05-23 10:06 ` Nicholas Piggin
2020-05-23 15:12 ` Masahiro Yamada
2020-05-23 16:53 ` Sam Ravnborg
2020-05-25 6:13 ` Masahiro Yamada
2020-06-15 21:47 ` Sami Tolvanen
2020-06-16 3:22 ` Masahiro Yamada
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='CAK7LNAQ1HTTSq-yp0t6Z4V-Z9PHg+O2n=NC89FJJFNQnhaOcSA@mail.gmail.com' \
--to=masahiroy@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).