From owner-freebsd-hackers Mon Aug 26 9:42: 8 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78B2F37B400; Mon, 26 Aug 2002 09:42:05 -0700 (PDT) Received: from scl8owa02.int.exodus.net (scl8out02.exodus.net [66.35.230.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB26B43E81; Mon, 26 Aug 2002 09:41:44 -0700 (PDT) (envelope-from Maksim.Yevmenkin@exodus.net) Received: from scl8owa01.int.exodus.net ([66.35.230.241]) by scl8owa02.int.exodus.net with Microsoft SMTPSVC(5.0.2195.4905); Mon, 26 Aug 2002 09:43:29 -0700 Received: from exodus.net ([206.220.227.147]) by scl8owa01.int.exodus.net over TLS secured channel with Microsoft SMTPSVC(5.0.2195.4905); Mon, 26 Aug 2002 09:43:29 -0700 Message-ID: <3D6A5A47.57672729@exodus.net> Date: Mon, 26 Aug 2002 09:41:43 -0700 From: Maksim Yevmenkin X-Mailer: Mozilla 4.78 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: John Baldwin Cc: "M. Warner Losh" , hackers@FreeBSD.ORG Subject: Re: Fast interrupts References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Aug 2002 16:43:29.0269 (UTC) FILETIME=[B4D09A50:01C24D1F] Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG John Baldwin wrote: > > On 26-Aug-2002 M. Warner Losh wrote: > > can you call wakeup(9) from a fast interrupt handler? [ ...] > > The only reason I ask is because sio seems to go out of its way to > > schedule a soft interrupt to deal with waking up processes, which then > > calls wakeup... > > Since wakeup only needs a spin lock, it is probably ok. You just can't call > anything that would sleep (in any interrupt handler) or block on a non-spin > mutex. what is the general locking technique for interrupt handlers? there must be some sort of locking, right? man atomic(9) says that current set of atomic operations do not necessarily guarantee atomicity across multiple processors. man mutex(9) says that MTX_DEF mutexes _might_ spin for some amount of time. but it is _only_ a machine specific optimization. MTX_SPIN are not recomended (correct me if i wrong). WITNESS gets upset when it finds "unlisted" MTX_SPIN mutex. for example NIC drivers call ether_input() from interrupt handlers which uses mutex to lock input queue. does that mean interrupt handler can/should use MTX_DEF mutex in this case? thanks, max To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message