🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Steven M. Schultz Wed, 17 Jan 1990 07:05
Network Device Interrupts Not Counted
#48
Author: Steven M. Schultz
Date: Wed, 17 Jan 1990 07:05
52 lines
2427 bytes
Subject: Network Device Interrupts Not Counted
Index:	sys/pdp/net_trap.s 2.10BSD

Description:
	Interrupts from network interfaces are not counted if metering
	(UCB_METER) is selected at system configuration time.

Repeat-By:
	Either by examination of the code, or by performing an rlogin
	to/from a 2.10.XBSD system and running 'vmstat' on another terminal.

Fix:
	Since the interrupt count is in kernel space, the count must
	be retrieved via "mfpd" and put back with "mtpd".  By performing
	the increment after the PSW has been loaded with 040340 the overhead
	of counting interrupts is reduced to only two instructions.

	Apply the following patch to /sys/pdp/net_trap.s and if UCB_METER
	is being used, recompile the kernel and networking.

*** net_trap.s.old	Tue Jul  5 14:20:04 1988
--- net_trap.s	Tue Jan 16 21:05:51 1990
***************
*** 33,42 ****
  	 * from kernel mode to the PS, PC pair we push on the kernel stack.
  	 *
  	 * Transfer our saved <PS, PC> pair to the kernel stack.  The spl7
! 	 * below is pure paranoia.
  	 */
  	mov	PS,-(sp)
  	mov	$40340,PS		/ current mode SUPV, prev KERN, BR7
  	mfpd	sp			/ old kernel stack pointer
  	mov	(sp),r1
  	sub	$4,(sp)			/ grow the kernel stack
--- 33,49 ----
  	 * from kernel mode to the PS, PC pair we push on the kernel stack.
  	 *
  	 * Transfer our saved <PS, PC> pair to the kernel stack.  The spl7
! 	 * below is pure paranoia, BUT while we're at it let's bump the
! 	 * interrupt count - it's a mere two instructions of overhead (the
! 	 * increment would have been done anyhow)!
  	 */
  	mov	PS,-(sp)
  	mov	$40340,PS		/ current mode SUPV, prev KERN, BR7
+ #ifdef	UCB_METER
+ 	mfpd	*$_cnt+V_INTR		/ fetch interrupt count
+ 	inc	(sp)			/ bump it
+ 	mtpd	*$_cnt+V_INTR		/ put it back
+ #endif
  	mfpd	sp			/ old kernel stack pointer
  	mov	(sp),r1
  	sub	$4,(sp)			/ grow the kernel stack
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads