From: Andrew Morton <akpm@linux-foundation.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc: calculate end pointer for /proc/*/* lookup at compile time
Date: Tue, 29 Jan 2019 14:18:48 -0800 [thread overview]
Message-ID: <20190129141848.5f3d2d1aa125c8ec45ee091d@linux-foundation.org> (raw)
In-Reply-To: <20190114200422.GB9680@avx2>
On Mon, 14 Jan 2019 23:04:23 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:
> Compilers like to transform loops like
>
> for (i = 0; i < n; i++) {
> [use p[i]]
> }
>
> into
> for (p = p0; p < end; p++) {
> ...
> }
>
> Do it by hand, so that it results in overall simpler loop
> and smaller code.
>
> Space savings:
>
> $ ./scripts/bloat-o-meter ../vmlinux-001 ../obj/vmlinux
> add/remove: 0/0 grow/shrink: 2/1 up/down: 4/-9 (-5)
> Function old new delta
> proc_tid_base_lookup 17 19 +2
> proc_tgid_base_lookup 17 19 +2
> proc_pident_lookup 179 170 -9
>
> Note: this trick bloats readdir, so don't do it :-\
I don't understand the Note:. Can you please expand?
next prev parent reply other threads:[~2019-01-29 22:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-14 20:04 [PATCH] proc: calculate end pointer for /proc/*/* lookup at compile time Alexey Dobriyan
2019-01-29 22:18 ` Andrew Morton [this message]
2019-01-30 5:55 ` Alexey Dobriyan
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=20190129141848.5f3d2d1aa125c8ec45ee091d@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=linux-kernel@vger.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).