From owner-freebsd-mobile@FreeBSD.ORG Mon Jul 24 18:23:29 2006 Return-Path: X-Original-To: freebsd-mobile@freebsd.org Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CFF2716A4DF for ; Mon, 24 Jul 2006 18:23:29 +0000 (UTC) (envelope-from douglas_goodall@mac.com) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.171]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7943243D4C for ; Mon, 24 Jul 2006 18:23:29 +0000 (GMT) (envelope-from douglas_goodall@mac.com) Received: from mac.com (smtpin01-en2 [10.13.10.146]) by smtpout.mac.com (Xserve/8.12.11/smtpout01/MantshX 4.0) with ESMTP id k6OINTcJ002662 for ; Mon, 24 Jul 2006 11:23:29 -0700 (PDT) Received: from dougwide (pool-71-102-161-156.snloca.dsl-w.verizon.net [71.102.161.156]) (authenticated bits=0) by mac.com (Xserve/smtpin01/MantshX 4.0) with ESMTP id k6OINME4002511 for ; Mon, 24 Jul 2006 11:23:28 -0700 (PDT) From: "Douglas W. Goodall" To: Date: Mon, 24 Jul 2006 11:23:27 -0700 Message-ID: <000301c6af4e$433d2b70$6dce46c0@dougwide> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcavTkGsZzYonsmGTRyXzpF3Fah14Q== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Subject: Doug's method for suppressing stray interrupt logging X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2006 18:23:29 -0000 Hello Yousef and All, In /usr/src/sys/i386/i386/intr_machdep.c: 197 /* 198 * For stray interrupts, mask and EOI the source, bump the 199 * stray count, and log the condition. 200 */ 201 if (ie == NULL || TAILQ_EMPTY(&ie->ie_handlers)) { 202 isrc->is_pic->pic_disable_source(isrc, PIC_EOI); 203 204 /* (*isrc->is_straycount)++; 205 if (*isrc->is_straycount < MAX_STRAY_LOG) 206 log(LOG_ERR, "stray irq%d\n", vector); 207 else if (*isrc->is_straycount == MAX_STRAY_LOG) 208 log(LOG_CRIT, 209 "too many stray irq %d's: not logging anymore\n", 210 vector); 211 */ 212 213 return; See line 204 where /* starts the suspension See line 211 where */ ends the suspension Ian, Your question was good. Since the IBM AT there have been two programmable interrupt controllers in the architecture. The second one is slaved off the first one attached to the IR7 line of the primary pic. The interrupt routine does the necessay things to remove a valid interrupt cause and sends the End of Interrupt (EOI)command to the PIC. In the case of the "default ir7", there is no valid cause and that is why it is called a stray interrupt. The interrupt code in 6.1 looks good but IMHO the code shouldn't bother to log the strays. The code is handling them properly and my only contention is that the messenger should be ignored. One coud say, "Gee my Sharp PC-MM20 has a noisy bus and gets more default ir7's than some other box", but in the pig picture a few extra trips into the interrupt code is not enough cycles to sneeze at. BTW: The reason I didn't just change the value of MAX_STRAY_LOG was a nagging concern that if too many Stray interrupts occurred (like 32768) there might be a signed/unsigned comparison problem in the code that might cause the logging suspension to fail unexpectedly. Is is a great honor for me to share some hard earned knowledge with the community. :-) Respectfully, Douglas W. Goodall FreeBSD Enthusiast