From: Dipankar Sarma <dipankar@in.ibm.com>
To: BALBIR SINGH <balbir.singh@wipro.com>
Cc: linux-kernel@vger.kernel.org,
Rusty Russell <rusty@rustcorp.com.au>,
Paul McKenney <paul.mckenney@us.ibm.com>,
lse-tech@lists.sourceforge.net
Subject: Re: [Lse-tech] Re: [RFC] Dynamic percpu data allocator
Date: Fri, 24 May 2002 14:43:01 +0530 [thread overview]
Message-ID: <20020524144301.D11249@in.ibm.com> (raw)
In-Reply-To: <20020524114318.A11249@in.ibm.com> <AAEGIMDAKGCBHLBAACGBKEKPCJAA.balbir.singh@wipro.com>
On Fri, May 24, 2002 at 02:08:50PM +0530, BALBIR SINGH wrote:
>
> Sure, I understand what you are talking about now. That makes a lot
> of sense, I will go through your document once more and read it.
> I was thinking of the two combined (allocating CPU local memory
> for certain data structs also includes allocating one copy per CPU).
> Is there a reason to delay the implementation of CPU local memory,
> or are we waiting for NUMA guys to do it? Is it not useful in an
> SMP system to allocate CPU local memory?
In an SMP system, the entire memory is equidistant from the CPUs.
So, any memory that is exclusively accessed by once cpu only
is CPU-local. On a NUMA machine however that isn't true, so
you need special schemes.
The thing about one-copy-per-cpu allocator that I describe is that
it interleaves per-cpu data to save on space. That is if you
allocate per-cpu ints i1, i2, it will be laid out in memory like this -
CPU #0 CPU#1
--------- --------- Start of cache line
i1 i1
i2 i2
. .
. .
. .
. .
. .
--------- ---------- End of cache line
The per-cpu copies of i1 and i2 for CPU #0 and CPU #1 are allocated from
different cache lines of memory, but copy of i1 and i2 for CPU #0 are
in the same cache line. This interleaving saves space by avoiding
the need to pad small data structures to cache line sizes.
This essentially how the static per-cpu data area in 2.5 kernel
is laid out in memory. Since copies for CPU #0 and CPU #1 for
the same variable are on different cache lines, assuming that
code that accesses "this" CPU's copy will not result in cache line
bouncing. On an SMP machine, I can allocate the cache lines
for different CPUs, where the interleaved data structures are
laid out, using the slab allocator. On a NUMA machine however,
I would want to make sure that cache line allocated for this
purpose for CPU #N is closest possible to CPU #N.
Thanks
--
Dipankar Sarma <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.
next prev parent reply other threads:[~2002-05-24 9:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-23 13:08 [RFC] Dynamic percpu data allocator Dipankar Sarma
2002-05-24 4:37 ` BALBIR SINGH
2002-05-24 6:13 ` Dipankar Sarma
2002-05-24 8:38 ` [Lse-tech] " BALBIR SINGH
2002-05-24 9:13 ` Dipankar Sarma [this message]
2002-05-24 11:59 ` BALBIR SINGH
2002-05-24 14:38 ` Martin J. Bligh
-- strict thread matches above, loose matches on Subject: below --
2002-05-30 13:56 Mala Anand
2002-05-30 17:55 ` Dipankar Sarma
2002-05-31 7:57 ` BALBIR SINGH
2002-05-31 8:40 ` Dipankar Sarma
2002-06-03 19:12 Mala Anand
2002-06-03 19:48 ` Dipankar Sarma
2002-06-04 12:05 Mala Anand
2002-06-04 21:11 Paul McKenney
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=20020524144301.D11249@in.ibm.com \
--to=dipankar@in.ibm.com \
--cc=balbir.singh@wipro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=paul.mckenney@us.ibm.com \
--cc=rusty@rustcorp.com.au \
/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