All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Christoph Lameter <cl@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Mel Gorman <mel@csn.ul.ie>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Subject: Re: [this_cpu_xx V7 1/8] this_cpu_ops: page allocator conversion
Date: Thu, 17 Dec 2009 09:23:40 +0900	[thread overview]
Message-ID: <4B297A0C.4060009@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.00.0912160849150.8572@router.home>

Hello,

On 12/16/2009 11:55 PM, Christoph Lameter wrote:
>>> The boot pageset initialization was moved into __build_all_zonelists(). We
>>> could move the zone->pageset initialization there too?
>>
>> Maybe that is a bit less scary. (at least for me :-) The reason why
> 
> Wel sorry moving the ->pageset assign to __build_all_zonelists does not
> work since __build_all_zonelists does not scan through
> zones. zone_pcp_init is called reliable first for all zones. I think just
> leave it at is.

Ah, well, alright.

>> I'm a bit worried is that different architectures handle percpu
>> pointers differently before setup_per_cpu_areas().  x86 sets up the
>> offsets and stuff such that cpu0 can access the original percpu
>> section in the kernel image.  ia64 sets up everything properly way
>> before setup_per_cpu_areas() and in some archs percpu pointers are
>> completely invalid before setup_per_cpu_areas().  So, percpu pointer
>> being handled in generic code which is being called before percpu
>> setup is a bit worrying.
> 
> True but we are not dereferencing a per cpu pointer here. It is simply the
> assignment of the unreferenced native per cpu address generated by the
> linker. This address is unaffected by allocator bootstrap.

Yeap, the code is fine.  Probably I'm just being a bit paranoid.  If
you don't mind, can you please add a comment pointing out that the
percpu pointer isn't dereferenced before later initialization is done
which happens after percpu initialization?

> The assignment of the final per cpu areas (dynamically allocated) occurs
> after all the other memory allocators have been bootstrapped.

Great, thanks for the explanation.

-- 
tejun

  reply	other threads:[~2009-12-17  0:22 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-14 22:03 [this_cpu_xx V7 0/8] Per cpu atomics in core allocators and cleanup Christoph Lameter
2009-12-14 22:03 ` [this_cpu_xx V7 1/8] this_cpu_ops: page allocator conversion Christoph Lameter
2009-12-15  3:53   ` Tejun Heo
2009-12-15 15:04     ` Christoph Lameter
2009-12-16  0:53       ` Tejun Heo
2009-12-16 14:55         ` Christoph Lameter
2009-12-17  0:23           ` Tejun Heo [this message]
2009-12-14 22:03 ` [this_cpu_xx V7 2/8] this_cpu ops: Remove pageset_notifier Christoph Lameter
2009-12-14 22:03 ` [this_cpu_xx V7 3/8] Use this_cpu operations in slub Christoph Lameter
2009-12-14 22:03 ` [this_cpu_xx V7 4/8] SLUB: Get rid of dynamic DMA kmalloc cache allocation Christoph Lameter
2009-12-14 22:03 ` [this_cpu_xx V7 5/8] this_cpu: Remove slub kmem_cache fields Christoph Lameter
2009-12-14 22:03 ` [this_cpu_xx V7 6/8] Make slub statistics use this_cpu_inc Christoph Lameter
2009-12-15  6:24   ` Eric Dumazet
2009-12-15 14:46     ` Christoph Lameter
2009-12-15 14:59       ` Eric Dumazet
2009-12-14 22:03 ` [this_cpu_xx V7 7/8] Module handling: Use this_cpu_xx to dynamically allocate counters Christoph Lameter
2009-12-15  4:03   ` Tejun Heo
2009-12-15 22:41     ` Rusty Russell
2009-12-16 16:10       ` Christoph Lameter
2009-12-17  0:25         ` Tejun Heo
2009-12-17  5:42           ` Rusty Russell
2009-12-14 22:03 ` [this_cpu_xx V7 8/8] Remove cpu_local_xx macros Christoph Lameter
2009-12-15  4:04   ` Tejun Heo
2009-12-15  6:37 ` [this_cpu_xx V7 0/8] Per cpu atomics in core allocators and cleanup Pekka Enberg
2009-12-15  6:47   ` Tejun Heo
2009-12-15 14:50     ` Christoph Lameter
2009-12-15 17:06 ` Mel Gorman
2009-12-16 14:44   ` Christoph Lameter
2009-12-16 21:36     ` Christoph Lameter
2009-12-15 17:43 ` Mathieu Desnoyers
2009-12-16  0:58   ` Tejun Heo
2009-12-16  1:40     ` Mathieu Desnoyers
2009-12-16  1:46       ` Tejun Heo
2009-12-17 13:39         ` Mathieu Desnoyers
2009-12-17 19:28           ` Christoph Lameter
2009-12-17 20:25             ` Mathieu Desnoyers
2009-12-17 20:43               ` Christoph Lameter
2009-12-18  0:13                 ` Mathieu Desnoyers
2009-12-18  0:27                   ` 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=4B297A0C.4060009@kernel.org \
    --to=tj@kernel.org \
    --cc=cl@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mel@csn.ul.ie \
    --cc=penberg@cs.helsinki.fi \
    /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.