Using taskset to set process affinity on multi-core/hyperthreading
Hi,
I have an Intel i7 machine (4 cores, 2 hyperthreads per core).
I would like to explicitly use 3 cores for a certain process - and run all the other processes (including system services and kernel processes) on the remaining core.
I've tried to "fish out" all the current pids (using ps -e combined in a perl script) and then run:
taskset -p 3 <pid>
(this sets the affinity mask to all the process so that'll see only core 0 - with its 2 hyperthreads)
This hangs the machine causing a kernel panic.
Any ideas why?
Is there an alternative way to carry out this procedure?
Thanks.
|