From: David Laight <David.Laight@ACULAB.COM>
To: "'Zhouyi Zhou'" <zhouzhouyi@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"pablo@netfilter.org" <pablo@netfilter.org>,
"jbenc@redhat.com" <jbenc@redhat.com>,
"brouer@redhat.com" <brouer@redhat.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
Subject: RE: [PATCH RFC] netfilter: cacheline aligning in struct netns_ct
Date: Wed, 12 Mar 2014 09:36:36 +0000 [thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D0F6DB542@AcuExch.aculab.com> (raw)
In-Reply-To: <1394610994-22794-1-git-send-email-yizhouzhou@ict.ac.cn>
From: Zhouyi Zhou
> not frequently changing components should share same cachelines
>
> Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
> ---
> include/net/netns/conntrack.h | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
> index fbcc7fa..69d2d58 100644
> --- a/include/net/netns/conntrack.h
> +++ b/include/net/netns/conntrack.h
> @@ -65,6 +65,12 @@ struct nf_ip_net {
> struct netns_ct {
> atomic_t count;
> unsigned int expect_count;
> + struct hlist_nulls_head unconfirmed;
> + struct hlist_nulls_head dying;
> + struct hlist_nulls_head tmpl;
> +
> + /* not frequently changing components should share same cachelines */
> + struct nf_ip_net nf_ct_proto ____cacheline_aligned_in_smp;
I'm not sure this has the effect you are trying to achieve.
Adding an __attribute__((aligned(n))) to a structure member not only
adds padding before the member, but also pads the member to a multiple
of the specified size.
With large cache lines you probably want neither.
IIRC one of the ppc systems has something like 256 byte cache lines
(and if it doesn't now, it might have soon).
So arbitrarily cache-line aligning structure members may not be a good idea.
In any case reducing the number of cache lines accessed, and the number
dirtied is probably more important than putting 'readonly' data in its
own cache lines.
David
next prev parent reply other threads:[~2014-03-12 9:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 7:56 Zhouyi Zhou
2014-03-12 9:26 ` Jesper Dangaard Brouer
2014-03-12 9:36 ` David Laight [this message]
2014-03-12 12:20 ` Zhouyi Zhou
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=063D6719AE5E284EB5DD2968C1650D6D0F6DB542@AcuExch.aculab.com \
--to=david.laight@aculab.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=jbenc@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=yizhouzhou@ict.ac.cn \
--cc=zhouzhouyi@gmail.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®