LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 02-13-2007, 12:14 PM   #1
Ashrack
Member
 
Registered: Oct 2005
Distribution: Ubuntu - Edgy Eft
Posts: 173

Rep: Reputation: 30
application can bring LINUX to its knees


This are the problems I have faced thus far:
1.When doing heavy disk usage mouse start to lag. DMA is enabled
2.A program can use 100% CPU even if it leads the system almost unresponsive. Isn't there a way that even if an app is using 100% CPU that the rest of the system should still be responsive?

I have posted this thread into the KERNEL because I believe that problem is the scheduler involved.

I have compiled Vanilla kernel 2.6.19.2. Perhaps I should also use the ConKolivas patchset. Would that help?

The kernel preempt settings:
Code:
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_BKL=y

Last edited by Ashrack; 02-13-2007 at 01:23 PM.
 
Old 02-13-2007, 01:17 PM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I'm not quite sure, but just to give an opinion, I myself have not met either of those problems this far: I do some CPU-intensive tasks like handling RAW photos (the bare file takes at least 50MB of disk space, compared to a JPEG which takes only a few MB or less) and during that my mouse isn't lagging; the program I'm using may itself become a little freezy or not-so-fast-responsible, at times even stop responding for a moment, but I can still use the rest of the system with ease. Other tasks do work a bit slower when the photo program is doing some heavy work, but generally the system works like a charm. I'm using a kernel version of 2.6.17 from Ubuntu 6.10 reposities, and have quite a regular system with 512MB DDR memory and 1GB of swap space available.

Not sure why your system is freezing (that sounds what Windows does, even if you didn't have any heavy duty for it), but it sounds definitely interesting; do you notice same things when using a stock kernel instead of a self-compiled one?

EDIT: forgot to mention, the CPU is an AMD Sempron, 1800MHz.
 
Old 02-13-2007, 01:28 PM   #3
Ashrack
Member
 
Registered: Oct 2005
Distribution: Ubuntu - Edgy Eft
Posts: 173

Original Poster
Rep: Reputation: 30
With the regular kernel I still get the same problem.
 
Old 02-17-2007, 10:31 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,672
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
It is entirely possible that the application is bogging down ... not Linux itself, but rather X-Windows. That is to say, the GUI subsystem.

It depends entirely upon the nature of the application.

---

Here's the soap: you see two things concurrently, and you assume that they are related:
  • CPU utilization is 100%.
  • The system is bogged down.
But it ain't necessarily so.

The Linux dispatcher wants to keep the CPU as busy as possible. When there is 100% demand for the CPU and the dispatcher is able to service that demand .. great! It is when demand exists that the dispatcher is not able to fulfill that you have troubles. Repeat: "100% CPU utilization" is goodness!

Therefore, the co-incident appearance of these two symptoms tells you something else; something different than what you might expect. It says that whatever is bogging-down the system, as seen by you the end-user, is not preventing the dispatcher from launching tasks at 100% efficiency. The tasks are therefore not blocking one another; there isn't a system-resource contention. Ergo, there must be some kind of lock or mutex contention. A flood of messages could do that. A backlog of un-processed GUI messages could do it too.
 
Old 02-17-2007, 11:37 PM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Saturated bus?
 
Old 02-18-2007, 06:51 AM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
1.When doing heavy disk usage mouse start to lag. DMA is enabled
The mouse start to lag
What kind of file system do you use?
Did you check your speed and dma with
hdparm -d 1 /dev/hda
hdparm -tT /dev/hda
?
 
Old 02-18-2007, 09:09 AM   #7
Ashrack
Member
 
Registered: Oct 2005
Distribution: Ubuntu - Edgy Eft
Posts: 173

Original Poster
Rep: Reputation: 30
SUNDIALSVCS
But shouldn't LINUX when an app eats 100% of CPU still try to be as responsive as possible and not allocate every CPU power to that specific GUI application making the mouse LAG? This is what Winblows does

QUAKEBOY02
What do U mean, I do not understand U?

NX5000
I tried XFS, JFS, ReiserFS, Reiser4 thus far and all of have this problem. So we can rule out FS.
Code:
tom@tomi:/usr/local/bin$ sudo hdparm -i /dev/hda

/dev/hda:

 Model=HDS722516VLAT80, FwRev=V34OA6EA, SerialNo=VN643ECDD6PBND
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=52
 BuffType=DualPortCache, BuffSize=7938kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
 IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
 AdvancedPM=yes: disabled (255) WriteCache=enabled
 Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:  ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6

 * signifies the current active mode

tom@tomi:/usr/local/bin$ sudo hdparm -tT /dev/hda

/dev/hda:
 Timing cached reads:   1692 MB in  2.00 seconds = 844.63 MB/sec
 Timing buffered disk reads:  144 MB in  3.01 seconds =  47.89 MB/sec

Last edited by Ashrack; 02-18-2007 at 09:12 AM.
 
Old 02-18-2007, 09:32 AM   #8
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
I don't think its the application that makes your mouse lag. It's a kernel task that eats the cpu.
I tend to prefer ext3 or ext4, which is the default filesystem for linux. XFS and reiser do exactly what you say on my system and that's not what I want since it's a desktop machine.
Depending on the application and how it is coded, the underlying kernel task will take over on your activities... nothing new. The same would happen in winblows probably.
What is your HZ value in .config?
 
Old 02-18-2007, 12:12 PM   #9
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
"QUAKEBOY02
What do U mean, I do not understand U?"

I was referring to the possibility that your processes are causing so much IO activity that the bus could saturate. IOW, it's pushing as many bytes as it can, so anything more, including mouse activity, simply has to get in line. I've seen the laggy mouse issue on my MSI-boarded machine which has a slower bus than my ASUS machine. I've been using it to compile the kernel, rip DVDs etc. If I get too much of that going on at once, the mouse gets laggy and the machine isn't as responsive. I think it helped somewhat when I changed the kernel timer frequency to 1000hz.
 
Old 02-18-2007, 12:55 PM   #10
Ashrack
Member
 
Registered: Oct 2005
Distribution: Ubuntu - Edgy Eft
Posts: 173

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by nx5000
Depending on the application and how it is coded, the underlying kernel task will take over on your activities... nothing new. The same would happen in winblows probably.
What is your HZ value in .config?
my HZ value is 1000.
I always thought that the kernel never dedicates all of the processing power to a single app and that it always leaves some breading room. Is this not correct?
 
Old 02-18-2007, 02:46 PM   #11
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
I don't think its the scheduler that is the problem in your setup. Probably the flow of data to the bus.
Can you give the result of this:
egrep IOSCH /proc/config**

On newer 2.6.20 kernels you can do better io limiting if its only a problem of disk access.

There are different policies for giving access to a thread, some are done by the kernel some are done by the thread itself.
I didn't see any real improvement for my usage with the CK patches.
There are also the -mm patches...
 
Old 02-19-2007, 03:37 AM   #12
Ashrack
Member
 
Registered: Oct 2005
Distribution: Ubuntu - Edgy Eft
Posts: 173

Original Poster
Rep: Reputation: 30
NX5000
Here's the output:
Code:
tom@tomi:~$ egrep IOSCH /boot/config-2.6.19.2-reiser4.fuse261.powernow.alsamodule
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
CONFIG_DEFAULT_IOSCHED="cfq"
 
Old 02-19-2007, 09:35 AM   #13
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
That was the tool I was talking about : ionice

On how many linux distro did you do the test?

Can you give me one application that exhibits the problem, so that I can try on my box? Every setup is different..

With CONFIG_IOSCHED_AS as the scheduler?
http://www.mjmwired.net/kernel/Docum...hing-sched.txt
Also some kernels (like the one in fedora 6) set CONFIG_PREEMPT_VOLUNTARY on

The scheduler is getting heavy modification since the 2.6. You have to try several configurations. I'm far from being an expert.

Trying Suse, Fedora or others would be helpful...


Last edited by nx5000; 02-19-2007 at 09:36 AM.
 
Old 02-19-2007, 12:03 PM   #14
crashmeister
Senior Member
 
Registered: Feb 2002
Distribution: t2 - trying to anyway
Posts: 2,541

Rep: Reputation: 47
Why don't you use the ubuntu kernel and see what that does?
Also there might be something enabled by default in ubuntu which doesn't play nice with a vanilla kernel.
 
Old 02-22-2007, 09:44 AM   #15
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,672
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Mouse-lag can come from many sources. In short, there are many possible interactions that could cause the behavior you are experiencing. Therefore, your first step should be to strive to diagnose where it is actually coming from. Don't just "thrash at it and see if something works."

Don't swap kernels. Don't start diddling with scheduler parameters or hard-disk queueing options. (Those are designed to balance multiple streams of I/O-requests; they're useless with only one.)

"Don't slap at it ... think." (Notez vous: I do not intend that to be a desparaging nor insulting comment!)

So, grab a legal-pad and a number-two pencil and start writing down as many possibilities as you can think of.

If DMA is on, then we know that the actual data-transfer happens without CPU intervention, the CPU being notified only when the transfer is complete. If the CPU is running at 100% all the while, then the bus cannot be saturated; nor would one expect it to be in any realistic system.

We don't know if the system is paging. (Find out.)

Anything at all having to do with "the mouse" on Linux involves several subsystems due to the client/server nature of the GUI. It is still a trivial amount of processing.

The most likely culprit is still probably that an application is either burning up whole time-slices, or that there are too many entries in the runlist and the scheduler has to round-robin between them.

Does this application intermingle CPU-intensive work and interactive work in the same thread? If so, that produces a paradox for the scheduler.

One good way to try to isolate the culprit is by running the program from a shell with the nice command, which lowers its scheduling priority. Oddly enough, resource-intensive programs that are niced often run faster and complete their work sooner, and if this application is the major source of the problem, the mouse-lag will disappear.

Last edited by sundialsvcs; 02-22-2007 at 09:56 AM.
 
  


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
Not able to bring Linux on network. rgouda Linux - Networking 8 08-04-2005 08:36 PM
Firefox theme has brought my Linux to it's knees fannymites Linux - Software 0 02-23-2005 08:04 AM
how i migrate windows application to Linux base application vandarakalpesh Linux - Software 0 06-26-2004 03:34 AM
how do i bring the linux window into a lindows Os ErichKnoop Red Hat 1 02-27-2004 10:19 AM
How to bring up application window to front from shell script. aleksas_m Linux - General 2 08-21-2003 01:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:42 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