From: Laurent Chavey <chavey@google.com>
To: netdev@vger.kernel.org
Cc: laurent chavey <chavey@google.com>
Subject: [RFC] change dst_entry padding from using an array to using __attribute__
Date: Wed, 7 Apr 2010 09:46:28 -0700 [thread overview]
Message-ID: <t2o97949e3e1004070946mfacef7c0la6bddc38d29720ae@mail.gmail.com> (raw)
what are the benefit(s) of using an array to force a struct
element to be aligned on 64 bytes / 32 bytes boundaries
versus using gcc __attribute__.
------------------------------------
struct dst_entry {
/*
* Align __refcnt to a 64 bytes alignment
* (L1_CACHE_SIZE would be too much)
*/
- #ifdef CONFIG_64BIT
- long __pad_to_align_refcnt[1];
- #else
- long __pad_to_align_refcnt[0];
- #endif
+ atomic_t __refcnt __attribute__
((aligned(64))); /* client references */
#undef __padding__
/*
* __refcnt wants to be on a different cache line from
* input/output/ops or performance tanks badly
*/
atomic_t __refcnt; /* client references */
};
next reply other threads:[~2010-04-07 16:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-07 16:46 Laurent Chavey [this message]
2010-04-07 16:55 ` [RFC] change dst_entry padding from using an array to using __attribute__ Eric Dumazet
2010-04-07 16:56 ` Eric Dumazet
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=t2o97949e3e1004070946mfacef7c0la6bddc38d29720ae@mail.gmail.com \
--to=chavey@google.com \
--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