CPU numbering & hyperthreading




On an Intel Xeon dual CPU machine running 2.6.16 and up...

I have two highly CPU/memory/network intensive processes with 3-5 threads each. I am using sched_setaffinity calls to make sure these two processes never compete for the same physical CPU. Am I right to assume that CPU #0 and #1 vs CPU #2 and #3 are separate physical CPUs on a 2-CPU w/ hyperthreading box?

I've spent some time looking, but I did not find documentation on exactly how CPUs are numbered in a hyperthreaded box.

For a process with N threads where N is generally <=5, where each thread shares access to the same large (300Mb) data structure across several threads, and which pumps the data from memory to a TCP socket, making many futex, select, write(), send() network calls (but no disk I/O), I assume it is best to keep said process on the same physical CPU but allow use both logical processors on that CPU (vs. keeping it to a single logical CPU)?

Thanks,
A.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Game Company- Java Server Thread Priority
    ... CPUs with hyperthreading don't "confuse" Windows into thinking ... No, there is no problem with hyperthreading, but read the article at the URL I ... logical processors on the same physical CPU instead of two logical processors. ...
    (comp.lang.java.programmer)
  • Re: Game Company- Java Server Thread Priority
    ... CPUs with hyperthreading don't "confuse" Windows into thinking ... No, there is no problem with hyperthreading, but read the article at the URL I ... logical processors on the same physical CPU instead of two logical processors. ...
    (comp.lang.java.help)
  • Re: Game Company- Java Server Thread Priority
    ... CPUs with hyperthreading don't "confuse" Windows into thinking ... No, there is no problem with hyperthreading, but read the article at the URL I ... logical processors on the same physical CPU instead of two logical processors. ...
    (comp.lang.java)
  • Re: improve strlen
    ... Your latest optimizations make the assembly version _slower_ ... CPU, chances are pretty good it *won't* be optimal on a different CPU. ... code that uses them) and employ a better internal data structure, ... whole issue of the "fastest strlen" algorithm would go away. ...
    (comp.lang.asm.x86)
  • Re: workqueue deadlock
    ... but it is still preemptible and the lock is specific. ... preempt_disableis the preferred way of holding off cpu hotplug. ... already (and can be programmatically attached to the data structure ... "CPU hotplug code" is the implementation of that data structure, ...
    (Linux-Kernel)