From: Paul Jackson <pj@sgi.com>
To: Ravikiran G Thirumalai <kiran@scalex86.org>
Cc: akpm@osdl.org, clameter@engr.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: remove __read_mostly?
Date: Mon, 26 Jun 2006 11:39:50 -0700 [thread overview]
Message-ID: <20060626113950.571d3e4c.pj@sgi.com> (raw)
In-Reply-To: <20060625211929.GA3865@localhost.localdomain>
Ravikiran wrote:
> The idea behind __read_mostly is to separate variables like cpu maps,
> bootcpuinfo etc which are written to very very rarely -- during
> initialization/hot-plugging, but read quite often something like ~100 % read
> ratio.
So these variables are __read_hot_write_cold?
In other words, the name __read_mostly is a little misleading, in my
book. That name only suggests read much more than written. In your
words:
something like 99:1 read
It doesn't state that the variable is so "read hot", it is worth keeping
off "write hot" cache lines.
Let's say for example we have a variable is accessed only once per
hour, and that this access is always a read except once a week (once
every 168 hours) when it is a write.
I would not mark that variable __read_mostly, even though it passed
your 99:1 test. That variable is read_cold_write_evencolder. It's an
ideal candidate for the canon fodder that we use to fill up the rest
of a cache line that has a hot variable.
If Andrew's suggestion to remove __read_mostly doesn't fly, then I'd
vote for a name change:
__read_mostly ==> __read_hot_write_cold
I think we want to identify the hottest memory words, keeping them
on separate cache lines, except that __read_hot_write_cold words can
share cache lines with each other.
A given cache line would have at most one hot write word, or one or
more read hot, write cold words.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.925.600.0401
next prev parent reply other threads:[~2006-06-26 18:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-25 18:57 remove __read_mostly? Andrew Morton
2006-06-25 21:19 ` Ravikiran G Thirumalai
2006-06-26 18:39 ` Paul Jackson [this message]
2006-06-26 18:46 ` Christoph Lameter
2006-06-26 19:11 ` Paul Jackson
2006-06-26 19:52 ` Ravikiran G Thirumalai
2006-06-25 21:44 ` Arjan van de Ven
2006-06-26 4:20 ` Christoph Lameter
2006-06-25 21:52 ` Arjan van de Ven
2006-06-26 4:17 ` Christoph Lameter
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=20060626113950.571d3e4c.pj@sgi.com \
--to=pj@sgi.com \
--cc=akpm@osdl.org \
--cc=clameter@engr.sgi.com \
--cc=kiran@scalex86.org \
--cc=linux-kernel@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