From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux.com>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andi Kleen <ak@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 2/2] include/linux: apply __malloc attribute
Date: Sat, 26 Mar 2016 20:06:13 +0100 [thread overview]
Message-ID: <87mvplukii.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <20160324153639.bb996d7bf5a585dfb46740b7@linux-foundation.org> (Andrew Morton's message of "Thu, 24 Mar 2016 15:36:39 -0700")
On Thu, Mar 24 2016, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Thu, 24 Mar 2016 00:42:32 +0100 Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:
>
>> Attach the malloc attribute to a few allocation functions. This helps
>> gcc generate better code by telling it that the return value doesn't
>> alias any existing pointers (which is even more valuable given the
>> pessimizations implied by -fno-strict-aliasing).
>>
> Shaves 6 bytes off my 1MB i386 defconfig vmlinux. Winner!
Well, the full bloat-o-meter summary is
add/remove: 0/0 grow/shrink: 72/155 up/down: 1165/-1674 (-509)
which sure still isn't much, but this isn't (just) about saving a few
bytes, but more about allowing gcc to generate better code; sometimes by
not having to reload, but also by enabling it to reorder instructions
(e.g. hoisting a load above a store) - the simple example was chosen
because it was very easy to see the relationship between the source and
the generated code.
Anyway, thanks for picking them up.
Rasmus
prev parent reply other threads:[~2016-03-26 19:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-23 23:42 [PATCH 1/2] compiler.h: add support for malloc attribute Rasmus Villemoes
2016-03-23 23:42 ` [PATCH 2/2] include/linux: apply __malloc attribute Rasmus Villemoes
2016-03-24 22:36 ` Andrew Morton
2016-03-26 19:06 ` Rasmus Villemoes [this message]
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=87mvplukii.fsf@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@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
all inboxes | Powered by JetHome®