Commit 090de0b7 authored by hawkes@sgi.com's avatar hawkes@sgi.com Committed by Tony Luck

[IA64] fix bug in sn/ia64 for sparse CPU numbering

The kernel's use of the for_each_*cpu(i) macros has allowed for sparse CPU
numbering.  When I hacked the kernel to test sparse cpu_present_map[] and
cpu_possible_map[] cpumasks, I discovered one remaining spot, in
sn_hwperf_ioctl() during sn initialization, that needs to be fixed.
Signed-off-by: default avatarJohn Hawkes <hawkes@sgi.com>
Signed-off-by: default avatarDean Roe <roe@sgi.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 9ad4f924
...@@ -743,13 +743,14 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg) ...@@ -743,13 +743,14 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg)
if ((r = sn_hwperf_enum_objects(&nobj, &objs)) == 0) { if ((r = sn_hwperf_enum_objects(&nobj, &objs)) == 0) {
memset(p, 0, a.sz); memset(p, 0, a.sz);
for (i = 0; i < nobj; i++) { for (i = 0; i < nobj; i++) {
int cpuobj_index = 0;
if (!SN_HWPERF_IS_NODE(objs + i)) if (!SN_HWPERF_IS_NODE(objs + i))
continue; continue;
node = sn_hwperf_obj_to_cnode(objs + i); node = sn_hwperf_obj_to_cnode(objs + i);
for_each_online_cpu(j) { for_each_online_cpu(j) {
if (node != cpu_to_node(j)) if (node != cpu_to_node(j))
continue; continue;
cpuobj = (struct sn_hwperf_object_info *) p + j; cpuobj = (struct sn_hwperf_object_info *) p + cpuobj_index++;
slice = 'a' + cpuid_to_slice(j); slice = 'a' + cpuid_to_slice(j);
cdata = cpu_data(j); cdata = cpu_data(j);
cpuobj->id = j; cpuobj->id = j;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment