LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-30-2007, 10:15 PM   #1
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 651

Rep: Reputation: 34
allocate a CPU for a process out of 4 CPUS


I have a multi processor machine in ML589 HP running RedHat AS3, is ti possible to dedicate one CPU out of four for a particular process. As this process is running slow

Thank you

Last edited by procfs; 12-30-2007 at 11:12 PM.
 
Old 12-30-2007, 10:20 PM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Look at the taskset command. In RedHat, it's in the schedutils package, I think.
 
Old 12-30-2007, 11:13 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,416

Rep: Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197
Depends on what you mean by dedicate. Taskset will ensure the nominated task(s) will only run on the specified CPU(s). Other work can also run there.

To isolate workloads to given subsets of the CPUs I use cpusets. Also has the advantage of being able to classify future work entering the system. Works well.
 
Old 12-30-2007, 11:36 PM   #4
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 651

Original Poster
Rep: Reputation: 34
What I ment was by dedicate, is to assign one out of four cpus just to handle this particular process (say process 123). This particular processor should handle only 123 process and other three will continue to performs as normal.

By the way by doing this will there be any draw basks.

Thanks

And I could not find cpuset command on my system though its a full installation
 
Old 12-30-2007, 11:46 PM   #5
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Well, with cpuset it's not that simple... First, it needs to be enabled in your kernel. Check with zcat /proc/config.gz | grep CPUSET
Then, you need to read this
http://www.mjmwired.net/kernel/Docum...on/cpusets.txt
and probably this
http://www.bullopensource.org/cpuset/
 
Old 12-31-2007, 12:00 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
If the task is CPU-bound, you might want to try decreasing the nice value before trying to dedicate it to a particular CPU. Note you'll need be root to set the nice value below 0 -- see the man pages of nice and renice for more information.
 
Old 12-31-2007, 12:01 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,416

Rep: Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197Reputation: 4197
Thx - saved me finding links; I'd ignore that bull one now-adays. They are still heavily involved, but you should just use the code in the mainline kernel.

It's still a work in progress too - major changes (amalgamation of code) came through in the last couple of -rc kernels. Doesn't affect cpusets already defined, but the doco changes significantly, and things are now handled via containers.
Still seems to work the same.
 
Old 12-31-2007, 12:28 AM   #8
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 651

Original Poster
Rep: Reputation: 34
Thanks guys I'll try and update this
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tweaking CPU Load and number of CPUs cabron Linux - Newbie 3 12-18-2007 09:59 AM
cpus for one process danfou Linux - Software 5 06-21-2007 10:37 AM
process cpu usage hamedrafi Programming 5 06-11-2007 06:32 PM
Run a process on more CPUs simonj82 Linux - Server 2 11-09-2006 08:51 PM
Process scheduling (CPU) kiwi_bloke *BSD 1 08-29-2004 09:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration