mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Denis Vlasenko" <vda.linux@googlemail.com>
To: "Andi Kleen" <andi@firstfloor.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	"Matt Mackall" <mpm@selenic.com>,
	"Jonathan Campbell" <jon@nerdgrounds.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Patches for REALLY TINY 386 kernels
Date: Mon, 30 Jul 2007 18:59:33 +0100	[thread overview]
Message-ID: <1158166a0707301059w26aade27r6d6e7b7dec08559c@mail.gmail.com> (raw)
In-Reply-To: <20070718210452.GG3898@one.firstfloor.org>

On Wednesday 18 July 2007 22:04, Andi Kleen wrote:
> Better just write less bloated code. Perhaps mandatory bloatometer
> runs during -rc*s for kernels with minimal config with public code pig shame lists
> similar to the regression lists are useful. Anyone volunteering?
>
> I suspect there is also much more low hanging fruit of this around.

Thousands "static int flag" variables taking 4 bytes where 1 byte
(actually 1 bit) would suffice. And when you do "flag = 1" -
store insns for bytes are also shorter by 3 bytes, _each_.

Unused code/data linked in
(-ffunction-sections -fdata-sections -Wl,--gc-sections may help)

int global_n; char global_c; int global_m;
and you lose 3 bytes to alignment.
(How to instruct linker to sort sections by alignment or at least for size?
Tried -ffunction-sections -fdata-sections -Wl,--sort-section,alignment
but it seems to only (try to) sort .data, not .data.var_name sections)

Massive inlining. Example: more than 80k of bloat in aic7*xx driver
because of gigantic inlined I/O access functions.

Sadistic alignment by gcc for structs/strings >= 32 bytes.
(gcc 4.2.1 is better, just don't forget -mpreferred-stack-boundary=2)
--
vda

  parent reply	other threads:[~2007-07-30 17:59 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-15 21:00 Jonathan Campbell
2007-07-15 21:42 ` Nigel Cunningham
2007-07-15 22:45   ` Alan Cox
2007-07-15 23:12     ` Nigel Cunningham
2007-07-15 23:14       ` Satyam Sharma
2007-07-15 23:13         ` Arnd Bergmann
2007-07-15 23:28           ` Satyam Sharma
2007-07-15 23:05 ` Adrian Bunk
2007-07-15 23:08 ` H. Peter Anvin
2007-07-17 10:59 ` Jan Engelhardt
2007-07-17 19:30   ` Matt Mackall
2007-07-18  2:33 ` Andi Kleen
2007-07-18 15:55   ` H. Peter Anvin
2007-07-18 18:20     ` Andi Kleen
2007-07-18 18:29       ` Jan Engelhardt
2007-07-18 18:38         ` Andi Kleen
2007-07-18 18:45           ` Jan Engelhardt
2007-07-18 18:47             ` Andi Kleen
2007-07-18 20:24         ` John Stoffel
2007-07-18 18:33     ` Adrian Bunk
2007-07-18 18:42       ` Jan Engelhardt
2007-07-18 18:44       ` Andi Kleen
2007-07-18 19:00       ` H. Peter Anvin
2007-07-21 10:09         ` Oleg Verych
2007-07-18 19:41     ` Matt Mackall
2007-07-18 19:50       ` H. Peter Anvin
2007-07-18 20:10       ` Andi Kleen
2007-07-18 20:24         ` H. Peter Anvin
2007-07-18 21:04           ` Andi Kleen
2007-07-18 22:17             ` H. Peter Anvin
2007-07-30 17:59             ` Denis Vlasenko [this message]
2007-07-18 20:41         ` Matt Mackall
2007-07-20  7:27           ` Uwe Hermann
2007-07-20  7:35             ` Andi Kleen
2007-07-24 14:49               ` Helge Hafting
2007-07-24 20:50                 ` Yinghai Lu
2007-07-24 22:56                   ` Adrian Bunk
2007-07-25  0:55                     ` Yinghai Lu
2007-07-24 22:45     ` Willy Tarreau
     [not found] <8HjYY-4Jk-15@gated-at.bofh.it>
     [not found] ` <8HlxM-7iT-13@gated-at.bofh.it>
     [not found]   ` <8HlxL-7iT-11@gated-at.bofh.it>
     [not found]     ` <8HlHq-7vR-17@gated-at.bofh.it>
     [not found]       ` <8HlHr-7vR-25@gated-at.bofh.it>
2007-07-16 13:12         ` Bodo Eggert

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=1158166a0707301059w26aade27r6d6e7b7dec08559c@mail.gmail.com \
    --to=vda.linux@googlemail.com \
    --cc=andi@firstfloor.org \
    --cc=hpa@zytor.com \
    --cc=jon@nerdgrounds.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.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

all inboxes | Powered by JetHome®