From freefall.cdrom.com!owner-freebsd-hackers Tue Aug 23 20:16:03 1994
Return-Path: <owner-freebsd-hackers@freefall.cdrom.com>
Received: from freefall.cdrom.com by tfs.com (smail3.1.28.1) with SMTP
	id m0qd8cD-0003xsa; Tue, 23 Aug 94 20:03 PDT
Received: (from root@localhost) by freefall.cdrom.com (8.6.8/8.6.6) id UAA06820 for freebsd-hackers-outgoing; Tue, 23 Aug 1994 20:00:31 -0700
Received: from Root.COM (implode.Root.COM [198.145.90.241]) by freefall.cdrom.com (8.6.8/8.6.6) with ESMTP id UAA06814 for <freebsd-hackers@freefall.cdrom.com>; Tue, 23 Aug 1994 20:00:24 -0700
Received: from corbin.Root.COM (corbin.Root.COM [198.145.90.2]) by Root.COM (8.6.8/8.6.5) with ESMTP id UAA00122; Tue, 23 Aug 1994 20:00:39 -0700
Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.9/8.6.5) with SMTP id TAA00449; Tue, 23 Aug 1994 19:59:59 -0700
Message-Id: <199408240259.TAA00449@corbin.Root.COM>
X-Authentication-Warning: corbin.Root.COM: Host localhost didn't use HELO protocol
To: batie@agora.rdrop.com, marc@dev.com
cc: freebsd-hackers@freefall.cdrom.com
Subject: apply this patch file
From: David Greenman <davidg@Root.COM>
Reply-To: davidg@Root.COM
Date: Tue, 23 Aug 1994 19:59:58 -0700
Sender: freebsd-hackers-owner@freefall.cdrom.com
Precedence: bulk
Status: RO

1) sio.c
   Disables automatic fifo trigger level adjustment. I don't think this was
ever a good idea. This is the likely cause of the sio serial problems on
puptent. I think the auto adjustment code is evil. Here's the scenario: You
get one or two sio overflows on one or two of the ports. The auto adjustment
code reduces the trigger level basically in half on those ports. Since you
have lots of ports on the machine, this increases the load just enough to
cause a few more overflows. This starts to reduce the trigger level toward
one (completely disabling the fifo). This causes the load to increase
dramatically (14 times higher) which causes overflows to occur on other ports.
These port's triggers are decreased to 1 and then the whole damn thing goes
south. With 4 or 5 active ports, this whole process can take less than 2
seconds.

2) kern_time.c
   Fixes a bug that causes NTP to not properly synchronize.

3) spec_vnops.c
   Fixes a bug that will cause a panic if the timing of a tty close is just
right. This was the cause of agora's crashes on the first day of operation
under 1.1.5.

-DG


Index: src/sys/i386/isa/sio.c
===================================================================
RCS file: /home/cvs/386BSD/src/sys/i386/isa/sio.c,v
retrieving revision 1.56
diff -c -r1.56 sio.c
*** 1.56	1994/06/16 08:08:44
--- sio.c	1994/08/24 02:30:38
***************
*** 1389,1394 ****
--- 1389,1395 ----
  					"sio%d: %u more %s%s (total %lu)\n",
  					    unit, delta, error_desc[errnum],
  					    delta == 1 ? "" : "s", total);
+ #if 0
  				if (errnum == CE_OVERRUN && com->hasfifo
  				    && com->ftl > FIFO_TRIGGER_1) {
  					static	u_char ftl_in_bytes[] =
***************
*** 1406,1411 ****
--- 1407,1413 ----
  					    ftl_in_bytes[com->ftl
  							 / FIFO_TRIGGER_DELTA]);
  				}
+ #endif
  			}
  		}
  		if (com->state & CS_ODONE) {
Index: src/sys/kern/kern_time.c
===================================================================
RCS file: /home/cvs/386BSD/src/sys/kern/kern_time.c,v
retrieving revision 1.5
diff -c -r1.5 kern_time.c
*** 1.5	1994/06/22 05:52:47
--- kern_time.c	1994/08/04 12:49:27
***************
*** 103,111 ****
  			return (error);
  		/* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */
  		boottime.tv_sec += atv.tv_sec - time.tv_sec;
! 		s = splclock();
! 		time.tv_sec = atv.tv_sec;	/* XXX avoid skew in tv_usec */
! 		splx(s);
  		resettodr();
  	}
  	if (uap->tzp && (error = copyin((caddr_t)uap->tzp, (caddr_t)&atz,
--- 103,109 ----
  			return (error);
  		/* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */
  		boottime.tv_sec += atv.tv_sec - time.tv_sec;
! 		s = splhigh(); time = atv; splx(s);
  		resettodr();
  	}
  	if (uap->tzp && (error = copyin((caddr_t)uap->tzp, (caddr_t)&atz,
Index: src/sys/kern/spec_vnops.c
===================================================================
RCS file: /home/cvs/386BSD/src/sys/kern/spec_vnops.c,v
retrieving revision 1.4
diff -c -r1.4 spec_vnops.c
*** 1.4	1994/05/30 03:20:08
--- spec_vnops.c	1994/08/24 02:26:18
***************
*** 137,145 ****
  		if ((u_int)maj >= nchrdev)
  			return (ENXIO);
  		VOP_UNLOCK(vp);
! 		vp->v_opencount++;
  		error = (*cdevsw[maj].d_open)(dev, mode, S_IFCHR, p);
! 		--vp->v_opencount;
  		VOP_LOCK(vp);
  		return (error);
  
--- 137,147 ----
  		if ((u_int)maj >= nchrdev)
  			return (ENXIO);
  		VOP_UNLOCK(vp);
! 		if (vp->v_specinfo)
! 			vp->v_opencount++;
  		error = (*cdevsw[maj].d_open)(dev, mode, S_IFCHR, p);
! 		if (vp->v_specinfo)
! 			--vp->v_opencount;
  		VOP_LOCK(vp);
  		return (error);
  
