LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-27-2012, 05:46 PM   #1
DKSL
LQ Newbie
 
Registered: Apr 2012
Posts: 29

Rep: Reputation: Disabled
Make process use more processor time


Hi all,

Is there a way to make a process use more processor time?

Thank you,
DK
 
Old 06-27-2012, 05:52 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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.
Old 06-27-2012, 06:17 PM   #3
DKSL
LQ Newbie
 
Registered: Apr 2012
Posts: 29

Original Poster
Rep: Reputation: Disabled
Actually I was looking for a method other than "nice" cus I have tried that but has not given impressive results..

http://www.linuxquestions.org/questi...4/#post4713589
 
Old 06-27-2012, 06:20 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
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.
Old 06-27-2012, 07:15 PM   #5
DKSL
LQ Newbie
 
Registered: Apr 2012
Posts: 29

Original Poster
Rep: Reputation: Disabled
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??
 
Old 06-27-2012, 08:34 PM   #6
whysoserious
Member
 
Registered: May 2012
Location: London
Distribution: Debian and slackware for uni
Posts: 61

Rep: Reputation: Disabled
Suicidaleggroll, you legend. Thanks, helped me out too.
 
Old 06-27-2012, 09:58 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
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.
Old 06-28-2012, 03:34 AM   #8
DKSL
LQ Newbie
 
Registered: Apr 2012
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
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)?
 
  


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
[SOLVED] How to save the pid of a process at the time of process startup jhonnappier2007 Linux - Newbie 13 11-21-2011 12:54 AM
Limiting Processor Use to a Process cheddarcheese Linux - Newbie 2 11-08-2011 09:55 PM
Need to find which processor is running a process demosp Linux - General 3 11-06-2007 08:34 PM
how can two process can be scheduled in two different processor in multi processor ? bishalpoudyal Programming 4 08-31-2006 03:22 PM
How do I know processor usage by a process bipinkdas Linux - Newbie 1 11-05-2005 12:45 AM


All times are GMT -5. The time now is 05:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration