LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-17-2010, 11:27 AM   #1
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
Configure cpu interrupts manually


I was installing freebds for one of my friends and during the entire install the top never crossed 1.0. When I install linux top always shows a cpu load of more than 1.0.
Also on the bsd when copying a huge file (4gb) it takes a long time but then the load never goes beyond 1.0. Linux will do it much faster but then there is a difference in the cpu load time.
What I want to know is is there anyway I can interupt the processor so that the load does not go beyond 1.0.
Thanks for reading.
 
Old 12-17-2010, 12:33 PM   #2
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
Under linux, load != cpu utilization. Under freebsd, it may.
The relationship between the two is indirect. The load average on linux only measures the task runqueue length. See http://www.teamquest.com/resources/g...ay/5/index.htm for more information.

Clear up the situation, a bit? High uptime load averages, under linux, aren't necessarily a bad thing.
 
Old 12-17-2010, 12:40 PM   #3
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Original Poster
Rep: Reputation: Disabled
Sorry if I was not very clear in the first post. In bsd I saw that the interrupts were very often and it took the load level down.
Is it possible for me to configure the interupt the processsor when say it is at .80 so that it would not cross .90 atleast. Since linux is so flexible I was wondering if I ever wanted to do that would I be able to.
 
Old 12-17-2010, 02:12 PM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by SilverBack View Post
Sorry if I was not very clear in the first post. In bsd I saw that the interrupts were very often and it took the load level down.
Is it possible for me to configure the interupt the processsor when say it is at .80 so that it would not cross .90 atleast. Since linux is so flexible I was wondering if I ever wanted to do that would I be able to.
How about simply using 'nice': http://linux.die.net/man/1/nice ?
 
Old 12-17-2010, 02:17 PM   #5
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Original Poster
Rep: Reputation: Disabled
Well I had thought about nice but then it cannot be changed at runtime - unless you are the root. So that is something I would not do.
Just hope I do not have to compile a kernel to get this functionality .
 
Old 12-17-2010, 02:18 PM   #6
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Original Poster
Rep: Reputation: Disabled
Well I had thought about nice but then it cannot be changed at runtime - unless you are the root. So that is something I would not do.
Just hope I do not have to compile a kernel to get this functionality .
 
Old 12-17-2010, 02:28 PM   #7
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by SilverBack View Post
Well I had thought about nice but then it cannot be changed at runtime - unless you are the root. So that is something I would not do.
Just hope I do not have to compile a kernel to get this functionality .
I do not understand what is the problem with load greater than 1 in the first place.
 
Old 12-17-2010, 05:24 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
So, you're not prepared to simply use su{do} to adjust a nice value, but you're prepared to hack to kernel to try and achieve this stupidity. You don't understand what you're seeing, but demand an answer to fit your mis-perception.

Go right ahead - it's your system.
 
Old 12-18-2010, 12:21 AM   #9
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Original Poster
Rep: Reputation: Disabled
@syg00 - No I am _not_ ready to hack the kernel to get this functionality. Using 'nice' is ok but to be honest I have rarely used it. Using 'nice' to achive the result is fine but then do you realise that I have to use nice _every_ time I am doing something computational intensive.
What I am looking for is somehow a more permanent fix where the load on the cpu does not cross 1.0.
This is not only about my system - I also want learn something more about the way the way I can control the processes eating away at the cpu.
 
Old 12-18-2010, 01:15 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
See post #7.
Loadavg is not "load on the cpu". The link above is relevant for Unix (including presumably freebsd) - not Linux.

Go read this. It's not completely accurate these days, but will give you a better idea of what loadavg is. Setting a "watermark" of 1.0 is meaningless - especially on multi-core/hiper-threaded chips, but even on single CPU.
 
Old 12-18-2010, 09:30 AM   #11
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by SilverBack View Post
@syg00 - No I am _not_ ready to hack the kernel to get this functionality. Using 'nice' is ok but to be honest I have rarely used it. Using 'nice' to achive the result is fine but then do you realise that I have to use nice _every_ time I am doing something computational intensive.
What I am looking for is somehow a more permanent fix where the load on the cpu does not cross 1.0.
This is not only about my system - I also want learn something more about the way the way I can control the processes eating away at the cpu.
There is nothing to fix. Furthermore, if you really want to increase the frequency of HW interrupts, you will be squandering CPU resources - every HW interrupt is an overhead because of saving/restoring registers and the need of kernel to check what to do next, i.e. to check whether current task needs to be suspended and which task needs to be resumed.
 
1 members found this post helpful.
Old 12-20-2010, 12:25 PM   #12
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by syg00 View Post
See post #7.
Loadavg is not "load on the cpu". The link above is relevant for Unix (including presumably freebsd) - not Linux.
Not sure if you're referring to my link, but the link I posted specifically outlines the fact that under linux load avg is NOT the same as task runqueue length. It uses Solaris as a comparison tool to show that under some systems, the two are directly related. Regardless, both above links were quite relevant, unless you can detail why they werent?

Additionally, the first line of the second post:
Quote:
Under linux, load != cpu utilization.
And the last line:
Quote:
High uptime load averages, under linux, aren't necessarily a bad thing.
The OP clearly didn't read that information.
 
  


Reply



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
Interrupts being processed by only 1 cpu duryodhan Slackware 35 09-10-2007 07:48 PM
configure usermin manually? taiwf Linux - Software 0 04-28-2006 02:23 AM
how to manually configure xorgconfig aquilolumen Linux - Newbie 8 08-01-2005 08:26 PM
manually controlling cpu speed (not overclocking... well maybe, im not sure) poiuytrewq Linux - General 3 05-14-2005 05:14 AM
hardware interrupts using too much cpu Rocker Linux - General 4 10-12-2004 05:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:22 PM.

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