From owner-freebsd-arch@FreeBSD.ORG Tue Jul 20 18:32:15 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 69B4E16A4CE; Tue, 20 Jul 2004 18:32:15 +0000 (GMT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i6KIWELp089278; Tue, 20 Jul 2004 14:32:14 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.12.11/8.12.11/Submit) id i6KIWEoa089277; Tue, 20 Jul 2004 14:32:14 -0400 (EDT) (envelope-from green) Date: Tue, 20 Jul 2004 14:32:13 -0400 From: Brian Fundakowski Feldman To: Poul-Henning Kamp Message-ID: <20040720183213.GC1009@green.homeunix.org> References: <75243.1090347623@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75243.1090347623@critter.freebsd.dk> User-Agent: Mutt/1.5.6i cc: arch@freebsd.org Subject: Re: kldunload DIAGNOSTIC idea... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2004 18:32:15 -0000 On Tue, Jul 20, 2004 at 08:20:23PM +0200, Poul-Henning Kamp wrote: > > I'm pulling hair out trying to make it guaranteed safe to unload device > driver modules, and the major pain here is to make sure there is no > thread stuck somewhere inside the code. > > That gave me the idea for a simple little DIAGNOSTIC check for kldunload: > run through the proc/thread table and look for any thread with an > instruction counter inside the range of pages we are going to unload. > > Any takers ? You mean any thread with a stack trace that includes an instruction counter inside those pages, don't you? -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\