mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Nicolas Pitre" <nico@fluxnic.net>
Cc: "Zhangjin Wu" <falcon@tinylab.org>,
	linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org,
	linux-riscv@lists.infradead.org,
	"Palmer Dabbelt" <palmer@rivosinc.com>,
	"Paul Walmsley" <paul.walmsley@sifive.com>,
	paulburton@kernel.org, "Paul E. McKenney" <paulmck@kernel.org>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Willy Tarreau" <w@1wt.eu>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Tim Bird" <tim.bird@sony.com>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>
Subject: Re: [PATCH v1 0/7] DCE/DSE: Add Dead Syscalls Elimination support, part1
Date: Wed, 27 Sep 2023 12:21:27 +0200	[thread overview]
Message-ID: <f636d6c8-d437-48d4-9582-33b3ee77c145@app.fastmail.com> (raw)
In-Reply-To: <6n7o7p99-9pr2-9orq-6nq1-093n7n7n43o9@syhkavp.arg>

On Tue, Sep 26, 2023, at 22:49, Nicolas Pitre wrote:
> On Tue, 26 Sep 2023, Arnd Bergmann wrote:
>
>> $ size build/tmp/vmlinux-*
>>    text	   data	    bss	     dec    hex	filename
>>   754772  220016  71841	 1046629  ff865	vmlinux-tinyconfig
>>   717500  223368  71841	 1012709  f73e5	vmlinux-tiny+nosyscalls
>>   567310  176200  71473	  814983  c6f87	vmlinux-tiny+gc-sections
>>   493278  170752  71433	  735463  b38e7	vmlinux-tiny+gc-sections+nosyscalls
>> 10120058 3572756 493701	14186515 d87813	vmlinux-defconfig
>>  9953934 3529004 491525	13974463 d53bbf	vmlinux-defconfig+gc
>>  9709856 3500600 489221	13699677 d10a5d	vmlinux-defconfig+gc+nosyscalls
>> 
>> This would put us at an upper bound of 10% size savings (80kb) for
>> tinyconfig, which is clearly significant. For defconfig, it's
>> still 2.0% or 275kb size reduction when all syscalls are dropped.
>
> I did something similar a while ago. Results included here:
>
> https://lwn.net/Articles/746780/
>
> In my case, stubbing out all syscalls produced a 7.8% reduction which 
> was somewhat disappointing compared to other techniques. Of course it 
> all depends on what is your actual goal.

Thanks for the link, I had forgotten about your article.

With all the findings combined, I guess the filtering
at the syscall table level is not all that promising
any more. Going through the list of saved space, I ended up
with 5.7% (47kb) in the best case after I left the 40 syscalls
from the example in this thread.

Removing entire groups of features using normal Kconfig symbols
based on the remaining syscalls that have the largest size
probably gives better results. I can see possible groups
of syscalls that could be disabled under CONFIG_EXPERT,
along with making their underlying infrastructure optional:

- xattr
- ptrace
- adjtimex
- splice/vmsplice/tee
- unshare/setns
- sched_*

After those, one would quickly hit diminishing returns.

     Arnd

  reply	other threads:[~2023-09-27 10:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25 22:33 Zhangjin Wu
2023-09-25 22:35 ` [PATCH v1 1/7] DCE: add debug support Zhangjin Wu
2023-09-25 22:36 ` [PATCH v1 2/7] DCE/DSE: add unused syscalls elimination configure support Zhangjin Wu
2023-10-07 10:01   ` Yuan Tan
2023-09-25 22:38 ` [PATCH v1 3/7] DCE/DSE: Add a new scripts/Makefile.syscalls Zhangjin Wu
2023-09-26  5:55   ` Arnd Bergmann
2023-09-25 22:40 ` [PATCH v1 4/7] DCE/DSE: mips: add HAVE_TRIM_UNUSED_SYSCALLS support Zhangjin Wu
2023-09-26  6:07   ` Arnd Bergmann
2023-10-07 12:58     ` Zhangjin Wu
2023-09-25 22:41 ` [PATCH v1 5/7] DCE/DSE: riscv: move syscall tables to syscalls/ Zhangjin Wu
2023-09-25 22:42 ` [PATCH v1 6/7] DCE/DSE: riscv: add HAVE_TRIM_UNUSED_SYSCALLS support Zhangjin Wu
2023-09-26  6:10   ` Arnd Bergmann
2023-10-07 13:29     ` Zhangjin Wu
2023-10-07 20:43       ` Arnd Bergmann
2023-09-25 22:43 ` [PATCH v1 7/7] DCE/DSE: riscv: trim syscall tables Zhangjin Wu
2023-09-26  6:01   ` Arnd Bergmann
2023-10-07 13:35     ` Zhangjin Wu
2023-09-26  7:14 ` [PATCH v1 0/7] DCE/DSE: Add Dead Syscalls Elimination support, part1 Arnd Bergmann
2023-09-26 11:24   ` Arnd Bergmann
2023-09-26 14:07     ` Arnd Bergmann
2023-09-26 20:49     ` Nicolas Pitre
2023-09-27 10:21       ` Arnd Bergmann [this message]
2023-09-30  9:31 ` Yuan Tan
2023-10-03 16:43 ` Yuan Tan

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=f636d6c8-d437-48d4-9582-33b3ee77c145@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=falcon@tinylab.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@weissschuh.net \
    --cc=nico@fluxnic.net \
    --cc=palmer@rivosinc.com \
    --cc=paul.walmsley@sifive.com \
    --cc=paulburton@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=tim.bird@sony.com \
    --cc=tsbogend@alpha.franken.de \
    --cc=w@1wt.eu \
    /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

all inboxes | Powered by JetHome®