lkml.org 
[lkml]   [2009]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: percpu memory setup and num_possible_cpus() vs. nr_cpu_ids
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


\
 
 \ /
  Last update: 2009-05-29 02:47    [W:1.037 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site