Re: smp_processor_id()?

David S. Miller (davem@dm.cobaltmicro.com)
Sun, 6 Dec 1998 20:37:09 -0800


Date: Sun, 6 Dec 1998 20:17:03 +0100 (CET)
From: MOLNAR Ingo <mingo@chiara.csoma.elte.hu>

valid values are:

smp_num_cpus: 0,1...NR_CPUS
smp_processor_id(): 0,1,...smp_num_cpus [consecutive]

the thing returned in /proc/cpuinfo is the 'physical' (APIC) number of the
CPU, which does not have to be consecutive. (but you should not be worried
about physical numbering, it shows up basically nowhere)

Last time I checked this is not how it worked.

Why does kernel/sched.c translate the number at all? It does because
the cpu_number_map[] view of the cpu numbers is the consecutive
mapping, current->processor (and thus smp_processor_id()) is the
hardware cpu number which can be non-consecutive.

Later,
David S. Miller
davem@dm.cobaltmicro.com

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