peter-lawrey/Java-Thread-Affinity — Issue #10: Core ids from cpuinfo are not in strict succession
Author: isopov
Created: 2012-01-27 10:04:56+00:00
State: open

I have two cores, In cpuinfo first have core id 0, and second have core id 2. Thats why the following assertion fails:

assert cpuDetails.size() == sockets * cores * threads; //cores here has value 3 instead of 2

How about using string "cpu cores	: 2" to know number of cores?

Complete /proc/cpuinfo:

processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model	: 37
model name	: Intel(R) Core(TM) i3 CPU 530 @ 2.93GHz
stepping	: 2
cpu MHz	: 1200.000
cache size	: 4096 KB
physical id	: 0
siblings	: 4
core id	: 0
cpu cores	: 2
apicid	: 0
initial apicid	: 0
fdiv_bug	: no
hlt_bug	: no
f00f_bug	: no
coma_bug	: no
fpu	: yes
fpu_exception	: yes
cpuid level	: 11
wp	: yes
flags	: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm arat tpr_shadow vnmi flexpriority ept vpid
bogomips	: 5866.15
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model	: 37
model name	: Intel(R) Core(TM) i3 CPU 530 @ 2.93GHz
stepping	: 2
cpu MHz	: 1200.000
cache size	: 4096 KB
physical id	: 0
siblings	: 4
core id	: 2
cpu cores	: 2
apicid	: 4
initial apicid	: 4
fdiv_bug	: no
hlt_bug	: no
f00f_bug	: no
coma_bug	: no
fpu	: yes
fpu_exception	: yes
cpuid level	: 11
wp	: yes
flags	: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm arat tpr_shadow vnmi flexpriority ept vpid
bogomips	: 5866.64
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model	: 37
model name	: Intel(R) Core(TM) i3 CPU 530 @ 2.93GHz
stepping	: 2
cpu MHz	: 1200.000
cache size	: 4096 KB
physical id	: 0
siblings	: 4
core id	: 0
cpu cores	: 2
apicid	: 1
initial apicid	: 1
fdiv_bug	: no
hlt_bug	: no
f00f_bug	: no
coma_bug	: no
fpu	: yes
fpu_exception	: yes
cpuid level	: 11
wp	: yes
flags	: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm arat tpr_shadow vnmi flexpriority ept vpid
bogomips	: 5866.62
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model	: 37
model name	: Intel(R) Core(TM) i3 CPU 530 @ 2.93GHz
stepping	: 2
cpu MHz	: 1200.000
cache size	: 4096 KB
physical id	: 0
siblings	: 4
core id	: 2
cpu cores	: 2
apicid	: 5
initial apicid	: 5
fdiv_bug	: no
hlt_bug	: no
f00f_bug	: no
coma_bug	: no
fpu	: yes
fpu_exception	: yes
cpuid level	: 11
wp	: yes
flags	: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm arat tpr_shadow vnmi flexpriority ept vpid
bogomips	: 5866.65
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management: