From owner-freebsd-hackers Wed Apr 30 01:25:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id BAA15508 for hackers-outgoing; Wed, 30 Apr 1997 01:25:21 -0700 (PDT) Received: from cheops.anu.edu.au (avalon@cheops.anu.edu.au [150.203.76.24]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id BAA15503 for ; Wed, 30 Apr 1997 01:25:17 -0700 (PDT) Message-Id: <199704300825.BAA15503@hub.freebsd.org> Received: by cheops.anu.edu.au (1.37.109.16/16.2) id AA270268666; Wed, 30 Apr 1997 18:24:26 +1000 From: Darren Reed Subject: Re: Unloading LKMs (was Re: A Desparate Plea for Help...) To: bde@zeta.org.au (Bruce Evans) Date: Wed, 30 Apr 1997 18:24:26 +1000 (EST) Cc: avalon@coombs.anu.edu.au, msmith@atrad.adelaide.edu.au, bde@zeta.org.au, hackers@FreeBSD.org In-Reply-To: <199704300805.SAA11920@godzilla.zeta.org.au> from "Bruce Evans" at Apr 30, 97 06:05:48 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk In some mail from Bruce Evans, sie said: > > >> > Er, AFAIK unloading LKM drivers is broken in all cases. It certainly > ^^^^^^^ > > >Hmmm, IP Filter unloads and reloads easily enough. > > It's not a driver. Actually, it is a character device module: MOD_DECL(if_ipl); static struct lkm_dev _module = { LM_DEV, LKM_VERSION, IPL_VERSION, CDEV_MAJOR, LM_DT_CHAR, (void *)&ipl_cdevsw }; > >However, give some thought to a process which is in a kernel sleep state, > >inside the LKM and theLKM is removed, leaving the process still sleeping > >on a now invalid address. > > Drivers are supposed to do nothing return nonzero in their unload function > if they are busy. I found that attempting to keep track of whether you are busy or not made things worse. Whether it be via signal 9 or whatever, it is somehow possible for things to not get cleaned up properly and you end up thinking you are busy when you aren't. Maybe this has changed or someone wants to look into it further ? Darren