I have this info from /proc/cpuinfo (shown below). My question is which core is hyperthreaded here. Secondly, which core lies on which processor, as there are two quad core processors here, as it is a dual socket system with 8 cores in total.
I interpret this as, core 0, 2, 4 and 6 are the 4 physical cores in processor 1, while core 1, 3, 5 and 7 are the 4 physical cores on processor 0. Cores 9-15 are the hyperthreaded ones. Is my interpretation correct?
-bash-3.2$ cat /proc/cpuinfo | grep 'physical id'
physical id : 1
physical id : 0
physical id : 1
physical id : 0
physical id : 1
physical id : 0
physical id : 1
physical id : 0
physical id : 1
physical id : 0
physical id : 1
physical id : 0
physical id : 1
physical id : 0
physical id : 1
physical id : 0
-bash-3.2$ cat /proc/cpuinfo | grep 'core id'
core id : 0
core id : 0
core id : 1
core id : 1
core id : 2
core id : 2
core id : 3
core id : 3
core id : 0
core id : 0
core id : 1
core id : 1
core id : 2
core id : 2
core id : 3
core id : 3
-bash-3.2$ cat /proc/cpuinfo | grep 'processor'
processor : 0
processor : 1
processor : 2
processor : 3
processor : 4
processor : 5
processor : 6
processor : 7
processor : 8
processor : 9
processor : 10
processor : 11
processor : 12
processor : 13
processor : 14
processor : 15
The best way to do it is just to benchmark it.
Write any trivial program that uses 2 threads. Then bind the threads to two cores.
If the performance drops significantly between a pair of cores versus another pair, then you know those two cores are on the same physical core.
I would trust a benchmark like this over whatever anything else tells you.
In Windows, the logical/physical cores are interleaved.
Cores 0,1 are on the same physical core.
Cores 2,3 are on the same…
Cores 4,5 are on the same… etc…
It may be different on Linux.