Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754712AbZANSSJ (ORCPT ); Wed, 14 Jan 2009 13:18:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752552AbZANSRx (ORCPT ); Wed, 14 Jan 2009 13:17:53 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:38352 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752143AbZANSRx (ORCPT ); Wed, 14 Jan 2009 13:17:53 -0500 Date: Wed, 14 Jan 2009 13:17:48 -0500 From: Kyle McMartin To: richard kennedy Cc: Kyle McMartin , Takashi Iwai , rusty@rustcorp.com.au, linux-kernel@vger.kernel.org Subject: Re: [PATCH] module: kzalloc mod->ref Message-ID: <20090114181748.GQ25103@bombadil.infradead.org> References: <20090114033533.GL25103@bombadil.infradead.org> <20090114155859.GO25103@bombadil.infradead.org> <496E261F.9000803@rsk.demon.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <496E261F.9000803@rsk.demon.co.uk> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1544 Lines: 34 On Wed, Jan 14, 2009 at 05:51:27PM +0000, richard kennedy wrote: > Aside from the code in socket does this reference count really get used > that often? Atomic_t gets used for ref counts is lots of other places in > the kernel, so why not turn module_ref into an atomic counter & drop the > array entirely saving all of the memory & disk space? > > I do wonder if socket could manage its module lifetimes in some other > way, then we really could just use an atomic module ref without too much > impact. I didn't get very far in trying to work out what exactly was > going on in socket.c but maybe it's worth another look. > I suppose it depends on how much contention there will end up being on the atomic_t, given that right now, the module_ref structure favours writers (since readers need to loop.) I'd like to hear what rusty has to say, but I'm working on a patch to do module_ref with RCU (and to allocate it in modpost with per_cpu variables, but that needs more testing.) I'll check what kind of difference those end up making. > I don't have any network test harness so it's difficult to tell what > impact any code change is going to have. Do you have any suggestions for > a good test of this? > No, but I imagine Rick Jones' netperf would show the effect, if any. cheers, Kyle -- 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/