Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server that is a quad-core i-7 with hyperthreading enabled. The kernel recognises this as 8 cpus, as it should. I want to create a couple virtual hosts running on this machine. virt-manager lets me select which cpus are used on which machine. I want to configure this so that I assign both cpus in a hyperthreaded pair to the same virtual machine. This way one machine under heavy load will not effect another virtual machine by sharing a single core due to the hyperthreading. But I do want hyperthreading available to each vm because I am running tasks that involve heavy parallelization.

So, how can I tell which cpus the kernel recognizes are a pair? I would suspect cpu 0 and cpu 1 make a pair, then cpu 2 and cpu 3, and so on, but I am not sure how to test/confirm.

share|improve this question
Which OS?...... – John Gardeniers Jan 28 '11 at 4:01
up vote 4 down vote accepted

This link describes how to match physical id, core id, and sibling count to identify which entries in /proc/cpuinfo are on the same core, but I can make no claims as to its accuracy. It also looks similar to this question.

share|improve this answer
Is there a cleaner way to determine which cores are which for CPU affinity purposes? – ewwhite Feb 26 '11 at 20:27
cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list

will print comma-separated list of sibling cores for a particular physical CPU/core. I used cpu0 (first core) as example.

The same information can be extracted from "core id" fields in /proc/cpuinfo (thanks user61849).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.