From owner-freebsd-questions@FreeBSD.ORG Tue Apr 22 19:50:53 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 336D237B401 for ; Tue, 22 Apr 2003 19:50:53 -0700 (PDT) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90FA843FBF for ; Tue, 22 Apr 2003 19:50:51 -0700 (PDT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id CB0AB51A6D; Wed, 23 Apr 2003 12:20:49 +0930 (CST) Date: Wed, 23 Apr 2003 12:20:49 +0930 From: Greg 'groggy' Lehey To: Aniruddha Bohra Message-ID: <20030423025049.GG49736@wantadilla.lemis.com> References: <3EA5B8CF.7080803@cs.rutgers.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0qt3EE9wi45a2ZFX" Content-Disposition: inline In-Reply-To: <3EA5B8CF.7080803@cs.rutgers.edu> User-Agent: Mutt/1.4i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 cc: freebsd-questions@FreeBSD.org Subject: Re: Interrupt threads X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 02:50:53 -0000 --0qt3EE9wi45a2ZFX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 22 April 2003 at 17:49:03 -0400, Aniruddha Bohra wrote: > Hello > Reading the implementation of interrupt handling on i386, > and reading Greg Lehey's Usenix paper on FreeBSD 5.0 SMP > implementation, I understand that interrupt handling is done in > process context. This is needed partly to support sleeping while > handling the interrupt because GIANT needs to be locked and > a sleep is possible there. > > My question is after all subsystems that lock giant are made > INTR_MPSAFE will the implementation go back to non-process > context interrupt handling (as in older versions) ? No. INTR_MPSAFE means that the ISRs use their own locking scheme. They can still sleep. > Moreover, will the locking be per-IRQ or there will be a global > IRQ lock for ensuring atomic access to the ISRs ? No. The locks will be finer grained, generally per device, not per IRQ. > Finally why do we need to create a kernel thread for each IRQ - > why can't one kernel thread handle all the IRQs ? If the kernel thread sleeps on one lock, everything would stop. Even if you accept that you're only processing one interrupt at a time, I can't think of a way to do this without instant deadlock. That's the whole point of having the threads in the first place. Greg -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply or reply to the original recipients. For more information, see http://www.lemis.com/questions.html See complete headers for address and phone numbers --0qt3EE9wi45a2ZFX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE+pf+JIubykFB6QiMRAiNbAJ0T/R+xBKahiGf3r9fTapsT6g+xCwCfX4Lk HreUn2gNEB2hTl7X0XFY33Y= =ge4F -----END PGP SIGNATURE----- --0qt3EE9wi45a2ZFX--