-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Vijay Kamarshi wrote: | Hello Linux experts, | | I am trying to figure out what Linux (2.6) mechanisms I have at my | disposal to allow deterministic operation on an Intel SMP machine. | | Basically we have a compute intensive algorithm we are trying to port to | an SMP machine. Following questions come to mind: | | 1) If I use a kernel level threading mechanism (like pThreads), will | different threads run on different processors (I presume this is the case)?
yes.
| | 2) How do I determine from userland (where my multi-threaded task is | running), which processor is handling a given thread?
top.
| | 3) If some of the threads in the user task need to interact with | hardware, can I give them a higher priority? (I am afraid to ask but | ...) Can I designate them as real-time threads?
yes. using sched_setscheduler() and other associated calls. | | 4) If I have more than one real-time thread, is there anyway I can | influence the scheduler to allocate a particular thread to a particular | processor? I am afraid that even if I can make 2 threads real-time, the | scheduler might not have the smarts to distribute them across different | processors.
I don't know if you can manipulate cpu affinity with the standard tools but you should be able to use something like Robert Love's schedutils from here http://www.tech9.net/rml/schedutils in order to designate a process/thread to a cpu. The 2.6.6 kernel does support cpu affinity out of the box (I believe), you just need tools to manipulate it.
| | 5) Could the kernel be fooled by hyperthreading into allocating multiple | real-time tasks to the same physical processor (that should logically | belong to different processors)?
Not 100% clear on this. My understanding is that the kernel doesn't differentiate between hyper-threading processors and physical processors. I think the kernel sees each of them all of them as different logical processors.
| | Thanks in advance for any help/pointers. | | -Vijay |
Someone feel free to correct me if I am full of it in my above assessments.
kr
- -- K.R. Foley kr@xxxxxxxxxx
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFA+DNeOSid126whWsRAmxuAJ0YQ09a+8QRzC1XlvCeXqW5DPXJ6QCgx2v+ R3UIwvAysG40/sHo2TLzdII= =RKtf -----END PGP SIGNATURE-----
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/