From: David Miller <davem@davemloft.net>
To: netdev@vger.kernel.org
Subject: [PATCH 0/7] Initialize flowi4 objects more efficiently.
Date: Thu, 31 Mar 2011 17:12:08 -0700 (PDT) [thread overview]
Message-ID: <20110331.171208.115926499.davem@davemloft.net> (raw)
When you do an initialization of an on-stack object such as:
struct foo x = { .member1 = bar, .member2 = baz };
GCC will emit a memset of the object, then fill in the parameters you
specify explicitly.
When the majority of the structure is being set explicitly, the memset
is basically unnecessary overhead. Emitting explicit stores to fill
in the zeros would be much cheaper, as well as avoid the function call
to memset.
Fix this for the cases which initialize most of the flowi4 object.
I therefore left alone cases such as:
struct flowi4 fl4 = { .daddr = daddr };
Since not only would any gains be minimal, we'd get code bloat and
much of such cases are also in the slow paths.
reply other threads:[~2011-04-01 0:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20110331.171208.115926499.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@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