From: =?utf-8?B?SsO2cm4=?= Engel Subject: Re: [Patch 09/18] fs/logfs/gc.c Date: Mon, 4 Jun 2007 11:01:26 +0200 Message-ID: <20070604090126.GB14823@lazybastard.org> References: <20070603183845.GA8952@lazybastard.org> <20070603184604.GJ8952@lazybastard.org> <200706040007.38578.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, akpm@osdl.org, Sam Ravnborg , John Stoffel , David Woodhouse , Jamie Lokier , Artem Bityutskiy , CaT , Jan Engelhardt , Evgeniy Polyakov , David Weinehall , Willy Tarreau , Kyle Moffett , Dongjun Shin , Pavel Machek , Bill Davidsen , Thomas Gleixner , Albert Cahalan , Pekka Enberg , Roland Dreier , Ondrej Zajicek , Ulisses Furquim To: Arnd Bergmann Return-path: Received: from lazybastard.de ([212.112.238.170]:55183 "EHLO longford.lazybastard.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877AbXFDJGG (ORCPT ); Mon, 4 Jun 2007 05:06:06 -0400 Content-Disposition: inline In-Reply-To: <200706040007.38578.arnd@arndb.de> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, 4 June 2007 00:07:36 +0200, Arnd Bergmann wrote: > On Sunday 03 June 2007, J=C3=B6rn Engel wrote: > > +static long decay(long t0, long t, long theta) > > +{ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0long shift, fac; > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (t >=3D 32*theta) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0return 0; > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0shift =3D t/theta; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0fac =3D theta - (t%theta= )/2; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return (t0 >> shift) * f= ac / theta; > > +} >=20 > I think it's confusion to work with 'long' arguments > here. If you actually allow larger than 32 bit arguments, > that means that the gc logic behaves differently on > 32 and 64 bit CPUs, which I don't think is what you > intended. Different behaviour would be fine. This function will be used to pick good candidates for garbage collection. If one segment will get chosen over another depending on BITS_PER_LONG, either one would have been a good candidate anyway. Hmm. Maybe I should s/32/BITS_PER_LONG/ in the function. > Also, can any of the arguments be negative? How about > making them all explicit u32 and u64 variables? That would make sense, yes. J=C3=B6rn --=20 I've never met a human being who would want to read 17,000 pages of documentation, and if there was, I'd kill him to get him out of the gene pool. -- Joseph Costello - 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