Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754613AbXL0Xz0 (ORCPT ); Thu, 27 Dec 2007 18:55:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753692AbXL0XzS (ORCPT ); Thu, 27 Dec 2007 18:55:18 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:48168 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753567AbXL0XzQ (ORCPT ); Thu, 27 Dec 2007 18:55:16 -0500 Date: Thu, 27 Dec 2007 23:54:37 +0000 From: Al Viro To: Christoph Lameter Cc: Theodore Tso , Andi Kleen , Willy Tarreau , Steven Rostedt , Linus Torvalds , Ingo Molnar , Peter Zijlstra , LKML , Andrew Morton , Christoph Hellwig , "Rafael J. Wysocki" Subject: Re: SLUB sysfs support Message-ID: <20071227235437.GI27894@ZenIV.linux.org.uk> References: <20071223141500.GB6430@one.firstfloor.org> <20071224034530.GB16658@thunk.org> <20071224233701.GB9784@kernel.org> <20071226221631.GD27894@ZenIV.linux.org.uk> <20071227225947.GH27894@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1228 Lines: 27 On Thu, Dec 27, 2007 at 03:22:28PM -0800, Christoph Lameter wrote: > > a) remove symlink when slab goes away > > Ok. Need to think about how to code that. Huh? Just call it from kmem_cache_destroy(); what business does that symlink have being around after that point? > > b) instead of kfree() in slab removal do kobject_put() if you have sysfs stuff > > Hmmmm.... Okay. Patch follows but its strange to do a kobject_put after a > kobject_del(). kobject_del() undoes the effect of kobject_add(). And then you are left with the refcount you had before kobject_add(), i.e. from kobject_init(). Think of it that way: kobject refcount controls the lifetime of structure the sucker's embedded into. Depending on kobject methods, you might be unable to do cleanup of non-kobject parts of that animal until after kobject_del(). IOW, you _can't_ have kobject_del() dropping the (hopefully) final reference to kobject - only the caller knows what might have to be done in between. -- 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/