Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2006 09:48:57 +0900
From:      Pyun YongHyeon <pyunyh@gmail.com>
To:        Mikhail Teterin <mi+mx@aldan.algebra.com>
Cc:        stable@freebsd.org
Subject:   Re: Extremely high-load -- due to pcm's IRQ-handling
Message-ID:  <20060817004857.GA49739@cdnetworks.co.kr>
In-Reply-To: <200608161618.35199.mi%2Bmx@aldan.algebra.com>
References:  <200608161618.35199.mi%2Bmx@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--vkogqOf2sHV7VnPd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Aug 16, 2006 at 04:18:34PM -0400, Mikhail Teterin wrote:
 > kmail prompted me for password, which I supplied. Then, all of a sudden,
 > the system slowed to a crawl -- even the mouse curse was barely moving.
 > 
 > It took many minutes to login from the outside and some more to start top.
 > 
 > Below you can see kmail in kserel keeping the processor(s) EXTREMELY busy.
 > Note also, the "load" figures.
 > 
 > According to `systat -vm', exactly 50% of the time is spent in "user", and the
 > other 50% -- either "sys" or in "irq" -- all of them in the pcm driver.
 > 
 > [...]
 >  1.6%Sys  43.7%Intr 49.1%User  0.0%Nice  5.7%Idl  1903516 inact       12: psm
 > |    |    |    |    |    |    |    |    |    |     122920 cache       15: ata
 > =++++++++++++++++++++++>>>>>>>>>>>>>>>>>>>>>>>>     15688 free        16: ahc
 >                                                           daefr 86002 17: pcm
 > [...]
 > 
 > The computer has two Opterons (single chip 275 with two cores) and is running
 > a recent 6.1-stable (amd64).
 > 
 > This happens about once a week. Sometimes a reboot is required, sometimes
 > killing the stuck process and kldunload-ing the snd_ich is sufficient...
 > 
 > Kmail is not using the audio in any way and the irq-17 is not shared with any
 > other device (dmesg attached). When snd_ich is loaded, it says, as expected:
 > 
 > pcm0: <AMD-8111> port 0xc800-0xc8ff,0xcc00-0xcc3f irq 17 at device 7.5 on pci0
 > pcm0: <Avance Logic ALC655 AC97 Codec>
 > 
 > What's going on? Thanks!
 > 
 > 	-mi
 > 
 > last pid:  5150;  load averages: 49.23, 52.22, 45.23   up 13+03:13:30  16:01:30
 > 158 processes: 2 running, 154 sleeping, 1 stopped, 1 zombie
 > CPU states: 50.0% user,  0.0% nice,  1.7% system, 22.6% interrupt, 25.8% idle
 > Mem: 1487M Active, 1859M Inact, 303M Wired, 120M Cache, 214M Buf, 16M Free
 > Swap: 4465M Total, 52K Used, 4465M Free
 > 
 >   PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU COMMAND
 >  5893 mi          3  20    0   298M   177M kserel 1 323:18 7634.18% kmail
 > 90397 root        1   5    0  7400K  1768K ttyin  1  97:01  1.12% systat
 > 80809 i           1 120    0   238M   224M select 0 160:18  0.68% firefox-bin
 >  2265 root        1  96    0   261M   144M select 0  49.0H  0.00% Xorg
 >  2267 root        1  96    0   184M 76428K select 0 149:40  0.00% Xorg
 > 18203 mi          4  20    0   179M 67696K kserel 0 135:45  0.00% kopete
 >  2336 i           1  96    0   134M 32132K select 0  71:43  0.00% kdeinit
 > 87056 i           1  96    0   118M 64392K select 0  52:09  0.00% acroread
 > [...]

Would you give attached patch try?

-- 
Regards,
Pyun YongHyeon

--vkogqOf2sHV7VnPd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ich.patch"

Index: ich.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/sound/pci/ich.c,v
retrieving revision 1.67
diff -u -r1.67 ich.c
--- ich.c	15 Aug 2006 07:37:41 -0000	1.67
+++ ich.c	17 Aug 2006 00:42:42 -0000
@@ -503,6 +503,11 @@
 
 	ICH_LOCK(sc);
 	gs = ich_rd(sc, ICH_REG_GLOB_STA, 4) & ICH_GLOB_STA_IMASK;
+	if (gs == 0) {
+		/* Not ours */
+		ICH_UNLOCK(sc);
+		return;
+	}
 	if (gs & (ICH_GLOB_STA_PRES | ICH_GLOB_STA_SRES)) {
 		/* Clear resume interrupt(s) - nothing doing with them */
 		ich_wr(sc, ICH_REG_GLOB_STA, gs, 4);

--vkogqOf2sHV7VnPd--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060817004857.GA49739>