From: Marc Zyngier <maz@kernel.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: enable dead code elimination
Date: Mon, 17 Jul 2023 13:15:18 +0100 [thread overview]
Message-ID: <864jm2vind.wl-maz@kernel.org> (raw)
In-Reply-To: <23d94414-b819-eaef-6fac-638bf713d341@huawei.com>
On Mon, 17 Jul 2023 12:56:39 +0100,
Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
>
>
> On 2023/7/17 17:42, Marc Zyngier wrote:
> > On 2023-07-17 09:07, Kefeng Wang wrote:
> >> Select CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION for arm64, allowing the
> >> user to enable dead code elimination. In order for this to work, ensure
> >> that we keep the necessary tables by annotating them with KEEP, also it
> >> requires further changes to linker script to KEEP some tables and
> >> wildcard
> >> compiler generated sections into the right place.
> >>
> >> The following comparison is based 6.5-rc2 with defconfig,
> >>
> >> $ ./scripts/bloat-o-meter vmlinux-base vmlinux-new
> >> add/remove: 3/1106 grow/shrink: 4102/6964 up/down: 35704/-99980 (-64276)
> >> Function old new delta
> >> ...
> >> Total: Before=17888959, After=17824683, chg -0.36%
> >>
> >> add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-44 (-44)
> >> Data old new delta
> >> ...
> >> Total: Before=4820808, After=4820764, chg -0.00%
> >>
> >> add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-1096 (-1096)
> >> RO Data old new delta
> >> ...
> >> Total: Before=5179123, After=5178027, chg -0.02%
> >>
> >> $ size vmlinux-base vmlinux
> >> text data bss dec hex filename
> >> 25433734 15385766 630656 41450156 2787aac vmlinux-base
> >> 24756738 15360870 629888 40747496 26dc1e8 vmlinux-new
> >>
> >> Memory available after booting, saving 704k on qemu,
> >> base: 8084532K/8388608K
> >> new: 8085236K/8388608K
> >>
> >> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> >
> > I took this patch for a spin in my tree, and ended up with:
> >
> > CC .vmlinux.export.o
> > UPD include/generated/utsversion.h
> > CC init/version-timestamp.o
> > LD .tmp_vmlinux.kallsyms1
> > ld: init/main.o(__patchable_function_entries): error: need linked-to
> > section for --gc-sections
> > make[2]: *** [scripts/Makefile.vmlinux:36: vmlinux] Error 1
> > make[1]: *** [/home/maz/hot-poop/arm-platforms/Makefile:1238:
> > vmlinux] Error 2
> > make: *** [Makefile:234: __sub-make] Error 2
>
> I don't find this error with CONFIG_FTRACE_MCOUNT_RECORD or
> allyesconfig, does it need special config or gcc version?
You tell me!
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
so hardly something special. This is built with the current state of
my NV tree, available here[1] As for the configuration, have a look
here[2].
M.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/nv-6.6-WIP
[2] https://paste.debian.net/1286106/
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-17 12:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-17 8:07 [PATCH] arm64: enable dead code elimination Kefeng Wang
2023-07-17 9:24 ` Will Deacon
2023-07-17 11:20 ` Kefeng Wang
2024-01-25 13:45 ` Yuntao Liu
2023-07-17 9:42 ` Marc Zyngier
2023-07-17 11:56 ` Kefeng Wang
2023-07-17 12:15 ` Marc Zyngier [this message]
2023-07-18 11:11 ` Kefeng Wang
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=864jm2vind.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangkefeng.wang@huawei.com \
--cc=will@kernel.org \
/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).