mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
synced 2026-04-05 00:08:32 -04:00
smp: add set_nr_cpu_ids()
In preparation to support compile-time nr_cpu_ids, add a setter for the variable. This is a no-op for all arches. Signed-off-by: Yury Norov <yury.norov@gmail.com>
This commit is contained in:
@@ -1070,7 +1070,7 @@ static int __init nrcpus(char *str)
|
||||
int nr_cpus;
|
||||
|
||||
if (get_option(&str, &nr_cpus) && nr_cpus > 0 && nr_cpus < nr_cpu_ids)
|
||||
nr_cpu_ids = nr_cpus;
|
||||
set_nr_cpu_ids(nr_cpus);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1097,7 +1097,7 @@ EXPORT_SYMBOL(nr_cpu_ids);
|
||||
/* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
|
||||
void __init setup_nr_cpu_ids(void)
|
||||
{
|
||||
nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
|
||||
set_nr_cpu_ids(find_last_bit(cpumask_bits(cpu_possible_mask), NR_CPUS) + 1);
|
||||
}
|
||||
|
||||
/* Called by boot processor to activate the rest. */
|
||||
|
||||
Reference in New Issue
Block a user