mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <teheo@novell.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: percpu memory setup and num_possible_cpus() vs. nr_cpu_ids
Date: Fri, 29 May 2009 09:38:06 +0900	[thread overview]
Message-ID: <4A1F2E6E.6030105@novell.com> (raw)
In-Reply-To: <4A1EBA000200007800003197@vpn.id2.novell.com>

Hello, Jan.

Jan Beulich wrote:
> Tejun,
> 
> this code of yours, as I learned the hard way during some Xen kernel work,
> assumes that cpu_possible_map is not sparse. While on native x86 this is
> certainly true, I wonder whether such a dependency should really exist in
> architecture neutral code. Below, for reference, the places I needed to
> change (4k allocator only). However, there are more instances of this in the
> other allocators - those seem more problematic, as they directly drive input
> to alloc_bootmem() (hence a lot of memory could be wasted, or allocation
> could even fail, with a very sparse cpu_possible_map if one would simply
> also use nr_cpu_ids here). In the remap (x86 - under the assumption that
> if this change gets made, it should also be made in x86 code, albeit not
> directly affected) allocator's case things may not be that bad, since the
> memory gets freed again at the end of setup_pcpu_remap().

There's other related larger issue.  It looks like possible but
offline configuration can be quite common with virtualization and
allocating for all possible cpus on boot can waste problematic amount
of space, so the plan is to allocate only for online cpus on boot and
allocate the rest as cpus come online.  This will require audit of
percpu users and probably a new cpumask representing cpus which have
ever been up.

The issue you're describing should be solved when the above is
implemented, right?

Thanks.

-- 
tejun

  reply	other threads:[~2009-05-29  0:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28 14:21 Jan Beulich
2009-05-29  0:38 ` Tejun Heo [this message]
2009-05-29  6:26   ` Jan Beulich

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=4A1F2E6E.6030105@novell.com \
    --to=teheo@novell.com \
    --cc=JBeulich@novell.com \
    --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

all inboxes | Powered by JetHome®