From: Rusty Russell <rusty@rustcorp.com.au>
To: "David S. Miller" <davem@redhat.com>
Cc: akpm@zip.com.au, torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] __cacheline_aligned_in_smp?
Date: Wed, 15 Jan 2003 19:02:20 +1100 [thread overview]
Message-ID: <20030115082444.0CFFA2C123@lists.samba.org> (raw)
In-Reply-To: Your message of "Mon, 13 Jan 2003 22:32:53 -0800." <20030113.223253.18825371.davem@redhat.com>
In message <20030113.223253.18825371.davem@redhat.com> you write:
> From: Rusty Russell <rusty@rustcorp.com.au>
> Date: Tue, 14 Jan 2003 12:10:12 +1100
>
> Hmm, you really want to weakly align it: you don't care if something follo
ws it on
> the cacheline, (ie. don't make it into an array, but it'd be nice if other
> things could share the cacheline) in UP.
>
> No, that is an incorrect statement.
>
> I want the rest of the cacheline to be absent of any write-possible
> data. There are many members in there which are read-only and thus
> will only consume a cacheline which would never need to be written
> back to main memory due to modification.
But it's not quite that simple, either. If we say dirty cachelines
cost twice as much as read-only ones (ie. read + write vs. read +
discard), it gives some guide. In particular, if a structure has
parts:
struct foo {
readonly R;
writeable W;
};
And it normally fits in one cacheline, but you set the alignment of W
to a cacheline, now it fits in two, you've lost. (Note, struct
tcp_hashinfo is not such a structure, this is just talking to the
gallery).
> You really don't understand what I'm trying to accomplish.
No. Thanks for the explanation.
> I want alignment on cache line boundary, and I don't want anything
> else in that cacheline.
A "read-mostly" section might be appropriate, then. Of course, you'd
have to split the structure, in that case, and it's not worth it if
there are only a few of these.
Have I finally got it through my thick skull now?
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
next prev parent reply other threads:[~2003-01-15 8:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-13 7:24 [PATCH] __cacheline_aligned_in_smp? Rusty Russell
2003-01-13 7:35 ` David S. Miller
2003-01-14 1:10 ` Rusty Russell
2003-01-14 6:32 ` David S. Miller
2003-01-15 8:02 ` Rusty Russell [this message]
2003-01-16 7:21 ` David S. Miller
2003-01-21 14:09 ` Bill Davidsen
2003-01-13 7:45 ` Jeff Garzik
2003-01-14 2:22 ` Rusty Russell
2003-01-13 9:41 ` David Gibson
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=20030115082444.0CFFA2C123@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=akpm@zip.com.au \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.