Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 2 Jul 2002 18:20:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 2 Jul 2002 18:20:45 -0400 Received: from leibniz.math.psu.edu ([146.186.130.2]:1277 "EHLO math.psu.edu") by vger.kernel.org with ESMTP id ; Tue, 2 Jul 2002 18:20:44 -0400 Date: Tue, 2 Jul 2002 18:23:12 -0400 (EDT) From: Alexander Viro To: Keith Owens cc: linux-kernel@vger.kernel.org Subject: Re: RE2: [OKS] Module removal In-Reply-To: <31775.1025581336@kao2.melbourne.sgi.com> 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 Content-Length: 1026 Lines: 24 On Tue, 2 Jul 2002, Keith Owens wrote: > Incrementing the use count at registration time is no good, it stops > the module being unloaded. Operations are deregistered at rmmod time. > Setting the use count at registration prevents rmmod from removing the > module, so you cannot deregister the operations. Catch 22. Right. So you should use try_inc_mod_count() before dereferencing the registered pointers and treat failure as "not found". > Module unload is not racy on UP without preempt. It is racy on SMP or > with preempt. It used to be safe on SMP because almost everything was > under the BKL, but that protection no longer exists. You forgot "as long as nothing blocks". Which is more than brittle - code changes routinely violate such warranties. - 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/