Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 19 Feb 2001 08:36:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 19 Feb 2001 08:36:34 -0500 Received: from mandrakesoft.mandrakesoft.com ([216.71.84.35]:13380 "EHLO mandrakesoft.mandrakesoft.com") by vger.kernel.org with ESMTP id ; Mon, 19 Feb 2001 08:36:29 -0500 Date: Mon, 19 Feb 2001 07:36:04 -0600 (CST) From: Philipp Rumpf To: Keith Owens cc: Alan Cox , linux-kernel@vger.kernel.org Subject: Re: Linux 2.4.1-ac15 In-Reply-To: <30512.982588558@ocs3.ocs-net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Feb 2001, Keith Owens wrote: > On Mon, 19 Feb 2001 06:15:22 -0600 (CST), > Philipp Rumpf wrote: > No need for a callin routine, you can get this for free as part of > normal scheduling. The sequence goes :- > > if (use_count == 0) { > module_unregister(); > wait_for_at_least_one_schedule_on_every_cpu(); > if (use_count != 0) { > module_register(); /* lost the unregister race */ > } > else { > /* nobody can enter the module now */ > module_release_resources(); > unlink_module_from_list(); > wait_for_at_least_one_schedule_on_every_cpu(); > free_module_storage(); > } > } > > wait_for_at_least_one_schedule_on_every_cpu() prevents the next wait_for_at_least_one_schedule_on_every_cpu() *is* callin_other_cpus(). I agree the name isn't optimal. (and yes, you could implement it by hacking sched.c directly, but I don't think that's necessary). > The beauty of this approach is that the rest of the cpus can do normal > work. No need to bring everything to a dead stop. Which nicely avoids potential deadlocks in modules that need to initialize on all CPUs. - 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/