Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934975Ab0HFRJf (ORCPT ); Fri, 6 Aug 2010 13:09:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8202 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933861Ab0HFRJc (ORCPT ); Fri, 6 Aug 2010 13:09:32 -0400 Date: Fri, 6 Aug 2010 13:09:08 -0400 From: Valerie Aurora To: Miklos Szeredi Cc: viro@zeniv.linux.org.uk, jblunck@suse.de, hch@infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 19/38] union-mount: Introduce union_dir structure and basic operations Message-ID: <20100806170908.GA16599@shell> References: <1276627208-17242-1-git-send-email-vaurora@redhat.com> <1276627208-17242-20-git-send-email-vaurora@redhat.com> <20100804194749.GA2134@shell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2671 Lines: 54 On Thu, Aug 05, 2010 at 12:28:18PM +0200, Miklos Szeredi wrote: > On Wed, 4 Aug 2010, Valerie Aurora wrote: > > > Why was the hash table concept dropped? The header comment still > > > talks about that? > > > > Simply, Al Viro didn't like it. But note that the current > > implementation still uses part of the hash table solution. You still > > have union_dir structures external to dentries for the read-only > > layers of the stack. The change is from Al's observation that the > > topmost dentry could only be part of one stack. Why do a lookup on > > the topmost dentry when you could keep an pointer to the stack in the > > dentry itself and skip the lookup? Once you have the head of the > > stack, you don't need lookup for the rest of it. This eliminates all > > the lookup machinery and the union hash table lock, which seems like a > > big win to me. > > That dentry field will be unused most of the time and we lose space > for d_iname for *all* filesystems. On 64bit this results in max > inline name going from 32 down to 24 bytes. On my root fs 7% of names > are 24-31 in length. That's more than triple that of names which are > more than 32 in length. > > Yeah, union mounts can be configured out, but that's not much > consolation for distros which want to enable this feature. I'll bring it up with Al. > > The biggest drawback of the hash table in my mind was that it > > introduced a new global synchronization point in lookup. Making it go > > fast would be dcache lookup optimization all over again. > > I already asked this, but I'll ask again, what about doing this with a > union filesystem? That solves this problem in one simple go, as well > as a host of others. > > I'll do some experimenting because I feel it should be possible to do > all this in a union fs with most of the advantages of union mounts. > That doesn't mean it won't need any VFS support, but I think the > amount of VFS burden can be considerably reduced with that approach at > a small price (just dentry tree duplication). That would be great. My theory on the current version is to do everything in the VFS except when it is much cleaner to make minor changes to the underlying fs. I went this way because I'd worked on a stacked file system version and couldn't see how to avoid the complexity that unionfs ran into. But a VFS/stacked fs hybrid might look nicer than a VFS/low-level fs hybrid. -VAL -- 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/