Re: Scheduler ( was: Just a second ) ...

Doug Ledford (dledford@redhat.com)
Tue, 18 Dec 2001 13:27:42 -0500


Andreas Dilger wrote:

> On Dec 18, 2001 09:27 -0800, Linus Torvalds wrote:
>
>>Maybe the best thing to do is to educate the people who write the sound
>>apps for Linux (somebody was complaining about "esd" triggering this, for
>>example).
>>
>
> Yes, esd is an interrupt hog, it seems. When reading this thread, I
> checked, and sure enough I was getting 190 interrupts/sec on the
> sound card while not playing any sound. I killed esd (which I don't
> use anyways), and interrupts went to 0/sec when not playing sound.
> Still at 190/sec when using mpg123 on my ymfpci (Yamaha YMF744B DS-1S)
> sound card.

Weel, evidently esd and artsd both do this (well, I assume esd does now, it
didn't do this in the past). Basically, they both transmit silence over the
sound chip when nothing else is going on. So even though you don't hear
anything, the same sound output DMA is taking place. That avoids things
like nasty pops when you start up the sound hardware for a beep and that
sort of thing. It also maintains state where as dropping output entirely
could result in things like module auto unloading and then reloading on the
next beep, etc. Personally, the interrupt count and overhead annoyed me
enough that when I started hacking on the i810 sound driver one of my
primary goals was to get overhead and interrupt count down. I think I
suceeded quite well. On my current workstation:

Context switches per second not playing any sound: 8300 - 8800
Context switches per second playing an MP3: 9200 - 9900
Interrupts per second from sound device: 86
%CPU used when not playing MP3: 0 - 3% (magicdev is a CPU pig once every 2
seconds)
%CPU used when playing MP3s: 0 - 4%

In any case, it might be worth the original poster's time in figuring out
just how much of his lost CPU is because of playing sound and how much is
actually caused by the windowing system and all the associated bloat that
comes with it now a days.

-- 

Doug Ledford <dledford@redhat.com> http://people.redhat.com/dledford Please check my web site for aic7xxx updates/answers before e-mailing me about problems

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/