Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 19 Feb 2001 07:18:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 19 Feb 2001 07:17:51 -0500 Received: from mandrakesoft.mandrakesoft.com ([216.71.84.35]:27984 "EHLO mandrakesoft.mandrakesoft.com") by vger.kernel.org with ESMTP id ; Mon, 19 Feb 2001 07:17:39 -0500 Date: Mon, 19 Feb 2001 06:15:22 -0600 (CST) From: Philipp Rumpf Reply-To: Philipp Rumpf To: Keith Owens cc: Alan Cox , linux-kernel@vger.kernel.org Subject: Re: Linux 2.4.1-ac15 In-Reply-To: <30069.982583679@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 Mon, 19 Feb 2001, Keith Owens wrote: > On Mon, 19 Feb 2001 11:35:08 +0000 (GMT), > Alan Cox wrote: > >The problem isnt running module code. What happens in this case > > > > mod->next = module_list; > > module_list = mod; /* link it in */ > > > >Note no write barrier. > > It works on ix86 so the code must be right Too bad it doesn't. > >Delete is even worse > > > >We unlink the module > >We free the memory > > > >At the same time another cpu may be walking the exception table that we free. > > Another good reason why locking modules via use counts from external > code is not the right fix. We definitely need a quiesce model for > module removal. Unless I'm mistaken, we need both use counts and SMP magic (though not necessarily as extreme as what the "freeze all other CPUs during module unload" patch did). I think something like this would work (in addition to use counts) int callin_func(void *p) { int *cpu = p; while (*cpu != smp_processor_id()) { current->cpus_allowed = 1 << *cpu; schedule(); } return 0; } void callin_other_cpus(void) { int cpus[smp_num_cpus]; int i; for (i=0; i