Re: [RFC] NR_CPUS=8 on a 32 cpu box

From: Tim Schmielau
Date: Fri Sep 05 2003 - 02:54:00 EST


> + if (num_processors > NR_CPUS){
> + printk(KERN_WARNING "NR_CPUS limit of %i reached. Cannot boot CPU(apicid 0x%d).\n", NR_CPUS, m->mpc_apicid);

I'm no expert in this field at all, but doesnt this need to check for '>=' ?

Also, the code following the check could get some reordering for
readability. How about the following:

--- linux-2.6.0-test4/arch/i386/kernel/mpparse.c.orig Fri Sep 5 09:40:07 2003
+++ linux-2.6.0-test4/arch/i386/kernel/mpparse.c Fri Sep 5 09:50:11 2003
@@ -167,15 +167,18 @@
boot_cpu_logical_apicid = apicid;
}

- num_processors++;
-
if (MAX_APICS - m->mpc_apicid <= 0) {
printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n",
m->mpc_apicid, MAX_APICS);
- --num_processors;
return;
}
ver = m->mpc_apicver;
+
+ if (num_processors >= NR_CPUS){
+ printk(KERN_WARNING "NR_CPUS limit of %i reached. Cannot boot CPU(apicid 0x%d).\n", NR_CPUS, m->mpc_apicid);
+ return;
+ }
+ num_processors++;

tmp = apicid_to_cpu_present(apicid);
physids_or(phys_cpu_present_map, phys_cpu_present_map, tmp);

Tim

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