From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 3 Oct 2007 11:00:25 -0700 (PDT) From: Christoph Lameter Subject: Re: [Patch / 002](memory hotplug) Callback function to create kmem_cache_node. In-Reply-To: <20071003234201.B5F9.Y-GOTO@jp.fujitsu.com> Message-ID: References: <20071002105422.2790.Y-GOTO@jp.fujitsu.com> <20071003234201.B5F9.Y-GOTO@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Yasunori Goto Cc: Andrew Morton , Linux Kernel ML , linux-mm List-ID: On Wed, 3 Oct 2007, Yasunori Goto wrote: > > > > That would work. But it would be better to shrink the cache first. The > > first 2 slabs on a node may be empty and the shrinking will remove those. > > If you do not shrink then the code may falsely assume that there are > > objects on the node. > > I'm sorry, but I don't think I understand what you mean... :-( > Could you explain more? > > Which slabs should be shrinked? kmem_cache_node and kmem_cache_cpu? The slab for which you are trying to set the kmem_cache_node pointer to NULL needs to be shrunk. > I think kmem_cache_cpu should be disabled by cpu hotplug, > not memory/node hotplug. Basically, cpu should be offlined before > memory offline on the node. Hmmm.. Ok for cpu hotplug you could simply disregard the per cpu structure if the per cpu slab was flushed first. However, the per node structure may hold slabs with no objects even after all objects were removed on a node. These need to be flushed by calling kmem_cache_shrink() on the slab cache. On the other hand: If you can guarantee that they will not be used and that no objects are in them and that you can recover the pages used in different ways then zapping the per node pointer like that is okay. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org