From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?SsO2cm4=?= Engel Subject: Re: [patch 10/15] fs/logfs/memtree.c Date: Fri, 11 Apr 2008 12:37:57 +0200 Message-ID: <20080411103756.GF25462@logfs.org> References: <20080401181308.512473173@logfs.org> <20080401181332.853833010@logfs.org> <200804101607.45409.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org To: Arnd Bergmann Return-path: Received: from lazybastard.de ([212.112.238.170]:57016 "EHLO longford.logfs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758104AbYDKKiH (ORCPT ); Fri, 11 Apr 2008 06:38:07 -0400 Content-Disposition: inline In-Reply-To: <200804101607.45409.arnd@arndb.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, 10 April 2008 16:07:44 +0200, Arnd Bergmann wrote: > On Tuesday 01 April 2008, joern@logfs.org wrote: > > +#if BITS_PER_LONG =3D=3D 32 > > +#define BTREE_NODES 20=C2=A0/* 32bit, 240 byte nodes */ > > +#else > > +#define BTREE_NODES 16=C2=A0/* 64bit, 256 byte nodes */ > > +#endif > > + > > +struct btree_node { > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0u64 key; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct btree_node *node; > > +}; >=20 > On 32 bit platforms other than x86, your struct btree_node > is 16 bytes long because of alignment requirements, rather > than the 12 bytes you are assuming. Indeed. Will change the definition. Long-term I'd like to generalize the btree a bit and allow three key variants: long, u64 and u8[]. Some people want to stuff a (u64, u64, u8) tupel into a btree. For those it seems ideal to just treat the key as an array and do memcmp() for comparison. J=C3=B6rn --=20 You can't tell where a program is going to spend its time. Bottlenecks occur in surprising places, so don't try to second guess and put in a speed hack until you've proven that's where the bottleneck is. -- Rob Pike -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html