Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 3 Jul 2002 19:45:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 3 Jul 2002 19:45:23 -0400 Received: from humbolt.nl.linux.org ([131.211.28.48]:62951 "EHLO humbolt.nl.linux.org") by vger.kernel.org with ESMTP id ; Wed, 3 Jul 2002 19:45:22 -0400 Content-Type: text/plain; charset=US-ASCII From: Daniel Phillips To: Pavel Machek , "Richard B. Johnson" Subject: Re: simple handling of module removals Re: [OKS] Module removal Date: Thu, 4 Jul 2002 01:48:59 +0200 X-Mailer: KMail [version 1.3.2] Cc: "Stephen C. Tweedie" , Bill Davidsen , Linux-Kernel Mailing List References: <20020702123718.A4711@redhat.com> <20020703034809.GI474@elf.ucw.cz> In-Reply-To: <20020703034809.GI474@elf.ucw.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Message-Id: <20020703234750Z16173-11563+874@humbolt.nl.linux.org> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1428 Lines: 36 On Wednesday 03 July 2002 05:48, Pavel Machek wrote: > Hi! > > Okay. So we want modules and want them unload. And we want it bugfree. > > So... then its okay if module unload is *slow*, right? > > I believe you can just freeze_processes(), unload module [now its > safe, you *know* noone is using that module, because all processes are > in your refrigerator], thaw_processes(). > > That's going to take *lot* of time, but should be very simple and very > effective. Hi Pavel, Is it just the mod_dec_use_count; return/unload race we're worried about? I'm not clear on why this is hard. I'd think it would be sufficient just to walk all runnable processes to ensure none has an execution address inside the module. For smp, an ipi would pick up the current process on each cpu. At this point the use count must be zero and the module deregistered, so all we're interested in is that every process that dec'ed the module's use count has succeeded in executing its way out of the module. If not, we try again later, or if we're impatient, also bump any processes still inside the module to the front of the run queue. I'm sure I must have missed something. -- Daniel - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/