From owner-cvs-all Tue May 8 7:54:39 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 507F337B422; Tue, 8 May 2001 07:54:30 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id AAA28256; Wed, 9 May 2001 00:54:27 +1000 Date: Wed, 9 May 2001 00:53:14 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: John Baldwin Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, Brian Somers Subject: RE: cvs commit: src/sys/dev/digi digi.c digi.h digi_isa.c digi_p In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 7 May 2001, John Baldwin wrote: > On 07-May-01 John Baldwin wrote: > > > > On 07-May-01 Brian Somers wrote: > >> brian 2001/05/07 04:13:13 PDT > >> > >> Modified files: > >> sys/dev/digi digi.c digi.h digi_isa.c digi_pci.c > >> Log: > >> Change COM_LOCK/COM_UNLOCK to a regular mutex - still conditional on > >> SMP being defined. > > > > Woah. COM_LOCK is a special case due to sio/cy using fast interrupt > > handlers, Except sio doesn't actually use it. It is a legacy from SMPog where some complications for locking were hidden in system-wide macros. > > and if digi is using a fast interrupt handler, then it needs to be a spin > > mutex, not a regular mutex. Also, mutexes should be on all the time, not > > just > >#ifdef SMP. Note that COM_LOCK is always defined now. > > Well, having checked the code, it seems you don't use fast interrupt handlers, > so you didn't need COM_LOCK to begin with and you don't need the mutex you are > using right now. I complained about this in private mail a couple of days ago. > tty drivers won't be locked until the tty subsystem is locked > and we figure out how we are going to lock tty data structures. And that will involve a lot more than locks in tty interrupt handlers. In SMPog, locking for tty interrupt handlers was so simple and efficient that it was done automatically in Xintr*(). Everything except the handlers needed explicit locking (spltty()). SMPng locking might involve locking each struct tty and hopefully no global locks. Perhaps a global lock (spltty() == mtx_lock(&Giant_tty_lock)) would be sufficient except for systems with hundreds of active ttys on >= 3 CPUs. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message