LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (http://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   How to exclusively assign process to a core? (http://www.linuxquestions.org/questions/linux-kernel-70/how-to-exclusively-assign-process-to-a-core-758253/)

nottix 09-28-2009 11:05 AM

How to exclusively assign process to a core?
 
Hi All,

i need to exclusively assign a process to a core on SMP system.
I should do that with a kernel module not in user-mode.

Is possible to do that?

Thanks

nottix

krkz 09-28-2009 12:36 PM

Hi.
Try CGroups mechanism. First you should enable appropriate options in your kernel. They are CONFIG_GROUP_SCHED and CONFIG_CGROUPS afair.
Then check this guide, it's very detail (its from Documentation/cgroups).

However, try man taskset. Maybe it will be enough.

nottix 09-28-2009 12:40 PM

Quote:

Originally Posted by krkz (Post 3699638)
Hi.
Try CGroups mechanism. First you should enable appropriate options in your kernel. They are CONFIG_GROUP_SCHED and CONFIG_CGROUPS afair.
Then check this guide, it's very detail.

However, try man taskset. Maybe it will be enough.

Thanks. I'll go to trying :-)

nottix 09-28-2009 02:55 PM

I tried CGroup, but it doesn't assign exclusively a process to core.

Example:
I have 4 cores, 20 processes.
Process 1 -> Core 1
Processes 2-19 -> Core 2-4

Every time a new process has been created it doesn't must be assigned to Core 1.

Any suggestions?

krkz 09-28-2009 04:16 PM

Well. How do you initiate your cgroups?

Maybe you should try to arrange cpuset1 for core1, cpuset2 for cores2-4.
Then add needed process to cpuset1 and all other processes, including init, to cpuset2. Thus, all new processes should be in cpuset2.

P.S. I have no possibility to test it today. Maybe in 1-2 days.

nottix 09-28-2009 04:38 PM

Ok. I'll try it soon.

P.S.: I read about cpuset.cpu_exclusive, is it a possible solution?

Thank you for your help :-)


All times are GMT -5. The time now is 04:58 AM.