From: Tejun Heo <tj@kernel.org>
To: suresh.b.siddha@intel.com
Cc: "JBeulich@novell.com" <JBeulich@novell.com>,
"andi@firstfloor.org" <andi@firstfloor.org>,
"mingo@elte.hu" <mingo@elte.hu>,
"linux-kernel-owner@vger.kernel.org"
<linux-kernel-owner@vger.kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PATCH] x86,percpu: fix pageattr handling with remap allocator
Date: Sun, 17 May 2009 10:23:54 +0900 [thread overview]
Message-ID: <4A0F672A.3000309@kernel.org> (raw)
In-Reply-To: <1242500964.27006.8636.camel@localhost.localdomain>
Hello, Suresh.
Suresh Siddha wrote:
> On Sat, 2009-05-16 at 08:16 -0700, Tejun Heo wrote:
>> Hello, Suresh.
>>
>> Suresh Siddha wrote:
>>> Tejun, Can you please educate me why we need to map this first
>>> percpu chunk (which is pre-allocated during boot and is physically
>>> contiguous) into vmalloc area?
>> To make areas for each cpu congruent such that the address offset of a
>> percpu symbol for CPU N is always the same from the address for CPU 0.
>
> But for the first percpu chunk, isn't it the case that the physical
> address allocations for a particular cpu is contiguous (as you are using
> one bootmem allocation for whole PMD_SIZE for any given cpu)? So both
> the kernel direct mapping aswell as the vmalloc mappings are contiguous
> for the first chunk, on any given cpu. Right?
Hmmm... okay. Percpu areas are composed of multiple chunks. A single
chunk is composed of multiple units, one unit for each CPU. Units in
a single chunk should be contiguous and of the same size such that
unit_addr_for_cpu_N == chunk_addr + N * unit_size whereas chunks don't
need to have any special address relation to other chunks. Combined,
this results in percpu addresses for CPU N are always offset by N *
unit_size from the percpu adresses for CPU 0 which can be efficiently
determined using some extra resource in the processor (segment
register on x86 for example).
For remap first chunk allocator, each unit for each CPU is allocated
separately using the bootmem allocator. Each unit is continuous but
they still need to be assembed into a single contiguous area to be
used as the first chunk, which is where the remapping comes in. So,
the extra requirement is that units in the same chunk need to be
contiguous and NUMA allocation means units will be spread according to
NUMA configuration, so they need to be put together by remapping them.
>>> Perhaps even for the other dynamically allocated secondary chunks?
>>> (as far as I can see, all the chunk allocations seems to be
>>> physically contiguous and later mapped into vmalloc area)..
>>>
>>> That should simplify these things quite a bit(atleast for first
>>> percpu chunk). I am missing something obvious I guess.
>> Hmm... Sorry I don't really follow. Can you please elaborate the
>> question?
>
> For the first percpu chunk, we can use the kernel direct mapping and
> avoid the vmalloc mapping of PMD_SIZE. And avoid the vmap address
> aliasing problem (wrt to free pages that we have given back to -mm) that
> we are trying to avoid with this patchset (as the existing cpa code
> already takes care of the kernel direct mappings).
Hmmm.... If you can show me how to use the linear mapping directly,
I'll be happy as a clam.
Thanks.
--
tejun
next prev parent reply other threads:[~2009-05-17 1:24 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-14 12:49 [GIT PATCH] x86,percpu: fix pageattr handling with remap allocator Tejun Heo
2009-05-14 12:49 ` [PATCH 1/4] x86: prepare setup_pcpu_remap() for pageattr fix Tejun Heo
2009-05-14 12:49 ` [PATCH 2/4] x86: simplify cpa_process_alias() Tejun Heo
2009-05-14 14:16 ` Jan Beulich
2009-05-14 15:37 ` Tejun Heo
2009-05-14 16:20 ` [PATCH UPDATED 2/4] x86: reorganize cpa_process_alias() Tejun Heo
2009-05-14 12:49 ` [PATCH 3/4] x86: fix pageattr handling for remap percpu allocator Tejun Heo
2009-05-14 16:21 ` [PATCH UPDATED " Tejun Heo
2009-05-14 12:49 ` [PATCH 4/4] x86: implement percpu_alloc kernel parameter Tejun Heo
2009-05-14 14:28 ` [GIT PATCH] x86,percpu: fix pageattr handling with remap allocator Jan Beulich
2009-05-14 15:55 ` Tejun Heo
2009-05-15 7:47 ` Jan Beulich
2009-05-15 8:11 ` Tejun Heo
2009-05-15 8:22 ` Jan Beulich
2009-05-15 8:27 ` Tejun Heo
2009-05-14 16:22 ` Tejun Heo
2009-05-15 4:00 ` Tejun Heo
2009-05-15 4:36 ` David Miller
2009-05-15 4:48 ` Tejun Heo
2009-05-16 1:17 ` Suresh Siddha
2009-05-16 15:16 ` Tejun Heo
2009-05-16 19:09 ` Suresh Siddha
2009-05-17 1:23 ` Tejun Heo [this message]
2009-05-18 19:20 ` Suresh Siddha
2009-05-18 19:41 ` H. Peter Anvin
2009-05-18 21:07 ` Suresh Siddha
2009-05-19 1:28 ` Tejun Heo
2009-05-20 23:01 ` Suresh Siddha
2009-05-21 0:08 ` Tejun Heo
2009-05-21 0:36 ` Suresh Siddha
2009-05-21 1:46 ` Tejun Heo
2009-05-21 1:48 ` Tejun Heo
2009-05-21 19:10 ` Suresh Siddha
2009-05-21 23:18 ` Tejun Heo
2009-05-22 0:55 ` Suresh Siddha
2009-05-19 9:44 ` Tejun Heo
2009-05-20 7:54 ` Ingo Molnar
2009-05-20 7:57 ` Tejun Heo
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=4A0F672A.3000309@kernel.org \
--to=tj@kernel.org \
--cc=JBeulich@novell.com \
--cc=andi@firstfloor.org \
--cc=hpa@zytor.com \
--cc=linux-kernel-owner@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
/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