Subject: port-i386/1033: NetBSD/i386 only tallies total IRQs handled on fast interrupts
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: Thorsten Lockert <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 05/07/1995 21:50:03
>Number:         1033
>Category:       port-i386
>Synopsis:       NetBSD/i386 only tallies total IRQs handled on fast interrupts
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May  7 21:50:02 1995
>Originator:     Thorsten Lockert
>Organization:
SigmaSoft, Th. Lockert
>Release:        May 7, 1995
>Environment:
System: NetBSD gandalf.sigmasoft.com 1.0A NetBSD 1.0A (GANDALF) #1: Sat Apr 15 02:02:08 PDT 1995 tholo@gandalf.sigmasoft.com:/usr/src/sys/arch/i386/compile/GANDALF i386


>Description:
	Hardware interrupts are only tallied for fast interrupts, thus
	making the v_intr field of the vmtotal structure almost always
	be 0.

	vmstat still needs to be updated to handle the i386 ports way
	of tallying individual interrupts
>How-To-Repeat:
	"vmstat -s"
>Fix:
	The following patch enables tallying of "slow" interrupts, but
	only if they are not masked.  Should this be done before going
	through the chain of handlers like I do here, before checking
	wether or not the IRQ is masked or when calling each handler?

	I chose to do it when we know we will actually execute code,
	possibly on a restart when changing the mask.

--- src/sys/arch/i386/isa/vector.s.orig	Sun May  7 21:20:53 1995
+++ src/sys/arch/i386/isa/vector.s	Sun May  7 21:34:16 1995
@@ -210,6 +210,7 @@
 	testb	$IRQ_BIT(irq_num),_cpl + IRQ_BYTE(irq_num)		;\
 	jnz	_Xhold/**/irq_num	/* currently masked; hold it */	;\
 _Xresume/**/irq_num/**/:						;\
+	incl	_cnt+V_INTR		/* statistical info */		;\
 	movl	_cpl,%eax		/* cpl to restore on exit */	;\
 	pushl	%eax							;\
 	orl	_intrmask + (irq_num) * 4,%eax				;\
>Audit-Trail:
>Unformatted: