Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754043AbYJTTy0 (ORCPT ); Mon, 20 Oct 2008 15:54:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753305AbYJTTyQ (ORCPT ); Mon, 20 Oct 2008 15:54:16 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:45984 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752197AbYJTTyQ (ORCPT ); Mon, 20 Oct 2008 15:54:16 -0400 Message-ID: <48FCE1C4.20807@linux-foundation.org> Date: Mon, 20 Oct 2008 14:53:40 -0500 From: Christoph Lameter User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Miklos Szeredi CC: penberg@cs.helsinki.fi, nickpiggin@yahoo.com.au, hugh@veritas.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: Re: SLUB defrag pull request? References: <1223883004.31587.15.camel@penberg-laptop> <1223883164.31587.16.camel@penberg-laptop> <200810132354.30789.nickpiggin@yahoo.com.au> <48F378C6.7030206@linux-foundation.org> <48FC9CCC.3040006@linux-foundation.org> <48FCCC72.5020202@linux-foundation.org> <48FCD7CB.4060505@linux-foundation.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1637 Lines: 34 Miklos Szeredi wrote: > So, isn't it possible to do without get_dentries()? What's the > fundamental difference between this and regular cache shrinking? The fundamental difference is that slab defrag operates on sparsely populated dentries. It comes into effect when the density of dentries per page is low and lots of memory is wasted. It defragments by kicking out dentries in low density pages. These can then be reclaimed. > Case below was brainfart, please ignore. But that doesn't really > help: the VFS assumes that you cannot umount while there are busy > dentries/inodes. Usually it works this way: VFS first gets vfsmount > ref, then gets dentry ref, and releases them in the opposite order. > And umount is not allowed if vfsmount has a non-zero refcount (it's a > bit more complicated, but the essense is the same). The dentries that we get a ref on are candidates for removal. Their lifetime is limited. Unmounting while we are trying to remove dentries/inodes results in two mechanisms removing dentries/inodes. If we have obtained a reference then invalidate_list() will return the number of busy inodes which would trigger the printk in generic_shutdown_super(). But these are inodes currently being reclaimed by slab defrag. Just waiting a bit would remedy the situation. We would need some way to make generic_shutdown_super() wait until slab defrag is finished. -- 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/