From owner-freebsd-smp Wed Dec 6 18: 0:42 2000 From owner-freebsd-smp@FreeBSD.ORG Wed Dec 6 18:00:40 2000 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id 3997037B400; Wed, 6 Dec 2000 18:00:38 -0800 (PST) Received: from hak.lan.Awfulhak.org (root@hak.lan.awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.1/8.11.1) with ESMTP id eB71wpx19082; Thu, 7 Dec 2000 01:58:51 GMT (envelope-from brian@lan.awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.1/8.11.1) with ESMTP id eB721Yt44116; Thu, 7 Dec 2000 02:01:34 GMT (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200012070201.eB721Yt44116@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: Julian Elischer Cc: Brian Somers , smp@FreeBSD.org, archie@FreeBSD.org, brian@Awfulhak.org Subject: Re: Netgraph and SMP In-Reply-To: Message from Julian Elischer of "Wed, 06 Dec 2000 06:49:50 PST." <3A2E520E.5E4444BD@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 07 Dec 2000 02:01:33 +0000 From: Brian Somers Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > > > Inside it's own lock (preventing any other dependent modules from > > appearing), it asks the module if it's ok to unload. > > > > This is obviously more tricky than it sounds. We've got to ensure > > that if any character device entry points have been created > > (make_dev() etc), we block the relevant entry points so that we can > > ENODEV if the MOD_UNLOAD works. > > but what if the process has already entered the driver? Then it should hold a lock that fails in the kldload syscall when it does a mutex_trylock() on it. Again, this is somewhere that a read/ write mutex would be handy. kldunload ends up trying for the write lock while driver entry points try for the read lock. -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message