Re: (resend) take3: Updated CPU Hotplug patches for IA64 (pjblessed) Patch [6/7]

From: Paul Jackson
Date: Tue May 11 2004 - 18:24:07 EST

Being somewhat thick in the head at times, it took me a lengthy private
email thread with Ashok to understand why he needed to add a
cpu_present_map for his cpu hotplug work, and just how that new map
related to the existing ones.

After patient and repeated explanations from Ashok, I worked out the
following explanation that he found accurate. On the off chance that
others find this way of phrasing it helpful, I post it here for the


Ashok's cpu hot plug patch adds a cpu_present_map, resulting in the
following cpu maps being available. All the following maps are fixed
size bitmaps of size NR_CPUS.

cpu_possible_map - map with all NR_CPUS bits set
cpu_present_map - map with bit 'cpu' set iff cpu is populated
cpu_online_map - map with bit 'cpu' set iff cpu available to scheduler
cpu_possible_map - map with bit 'cpu' set iff cpu is populated
cpu_present_map - copy of cpu_possible_map
cpu_online_map - map with bit 'cpu' set iff cpu available to scheduler

In either case, NR_CPUS is fixed at compile time, as the static size of
these bitmaps. The cpu_possible_map is fixed at boot time, as the set
of CPU id's that it is possible might ever be plugged in at anytime
during the life of that system boot. The cpu_present_map is dynamic(*),
representing which CPUs are currently plugged in. And cpu_online_map is
the dynamic subset of cpu_present_map, indicating those CPUs available
for scheduling.

If HOTPLUG is enabled, then cpu_possible_map is forced to have all
NR_CPUS bits set, otherwise it is just the set of CPUs that ACPI reports
present at boot.

If HOTPLUG is enabled, then cpu_present_map varies dynamically,
depending on what ACPI reports as currently plugged in, otherwise
cpu_present_map is just a copy of cpu_possible_map.

(*) Well, cpu_present_map is dynamic in the hotplug case.
If not hotplug, it's the same as cpu_possible_map, hence
fixed at boot.

I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at