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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-27-2012, 05:46 PM
|
#1
|
LQ Newbie
Registered: Apr 2012
Posts: 29
Rep:
|
Make process use more processor time
Hi all,
Is there a way to make a process use more processor time?
Thank you,
DK
|
|
|
06-27-2012, 05:52 PM
|
#2
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
In linux you can set a "nice" priority for a process. this doesnt really allocate more cpu cycles but the kernel will prioritize it based upon its "nice" value.
Here is a decent review of nice that I was able to find that breaks it down for you:
http://www.techrepublic.com/blog/ope...-with-nice/140
|
|
1 members found this post helpful.
|
06-27-2012, 06:20 PM
|
#4
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
It may come down to a problem with your code. Processes will use as much CPU time as 1) they are capable of, and 2) there is available. Nice/renice works on #2, giving the process priority so it will "steal" cpu cycles from other, less important processes. #1 comes down to your code though. Your code might not be using more of the CPU, not because the OS doesn't want to give it more CPU time, but because it's being bottlenecked elsewhere, such is memory or I/O access.
|
|
1 members found this post helpful.
|
06-27-2012, 07:15 PM
|
#5
|
LQ Newbie
Registered: Apr 2012
Posts: 29
Original Poster
Rep:
|
Well thats a good point thank you. I have a kernel module to change the nice value of a given process, may be I have tested it with a wrong application(I used a music player). May be most of the time it is blocked on I/O.. How ever if it is not #1 is there a guarantee/ can we say for sure it will get/use more cpu cycles?
I don't mind some kind of hack even, don't know it this is possible it is an idea that struck me. Changing the vruntime value(giving a small value) of a process, will it be more reliable than nice in improving #2 (am assuming this because CFS scheduler selects the process with the smallest vruntime & continue giving it a small value through a module)
#1 seems beyond my control ryt? cuz I am not going to change the applications/ processes.
Are there any other ways to improve on #2 other than nice??
|
|
|
06-27-2012, 08:34 PM
|
#6
|
Member
Registered: May 2012
Location: London
Distribution: Debian and slackware for uni
Posts: 61
Rep:
|
Suicidaleggroll, you legend. Thanks, helped me out too.
|
|
|
06-27-2012, 09:58 PM
|
#7
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,405
|
I'd write a custom program to test it.
A music player (like any prog) may be i/o bound on reading from disk; it will also be i/o bound on playing... you don't want the Minuet Waltz in 15 sec
(a musical joke)
You can certainly raise (if root) the priority of a process via nice or equiv kernel fn.
|
|
1 members found this post helpful.
|
06-28-2012, 03:34 AM
|
#8
|
LQ Newbie
Registered: Apr 2012
Posts: 29
Original Poster
Rep:
|
Quote:
Originally Posted by chrism01
I'd write a custom program to test it.
A music player (like any prog) may be i/o bound on reading from disk; it will also be i/o bound on playing... you don't want the Minuet Waltz in 15 sec
(a musical joke)
You can certainly raise (if root) the priority of a process via nice or equiv kernel fn.
|
Some cpu intensive calculation ryt? like calculating PI or can you point to any other good example..
Assuming a process is not i/o bound and have root permissions will nice give more CPU cycles to a process?? what are the chances of getting and not getting more CPU cycles and under what situations?
Asking for curiosity is there any other way(not using nice) to give more CPU cycles to a process(non i/o bound process)?
|
|
|
All times are GMT -5. The time now is 04:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|