lkml.org 
[lkml]   [2006]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] percpu data: only iterate over possible CPUs
Heiko Carstens a écrit :
>> for (cpu = max_cpus ; cpu < NR_CPUS ; cpu++)
>> cpu_clear(cpu, cpu_possible_map);
>
> Hmm... I don't think the semantics of cpu_possible_map allow to change it.
> Also any code that uses for_each_cpu() may allocate memory _before_
> cpu_possible_map is changed back to reflect a smaller number of cpus.
> Doesn't look like the correct way to fix this.
> Thinking a bit longer this was probably a reason why initialization of
> this map was done in smp_prepare_cpus() before it silently moved to
> setup_arch().

Hum... of course you may loose some bits of memory (percpu data for example)
but clearing a cpu in cpu_possible_map is allowed.

See arch/alpha/kernel/process.c and arch/x86_64/kernel/smpboot.c for uses of
cpu_clear()


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-09 14:59    [W:0.055 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site