Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750750AbWC1HPj (ORCPT ); Tue, 28 Mar 2006 02:15:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751114AbWC1HPj (ORCPT ); Tue, 28 Mar 2006 02:15:39 -0500 Received: from ecfrec.frec.bull.fr ([129.183.4.8]:26603 "EHLO ecfrec.frec.bull.fr") by vger.kernel.org with ESMTP id S1750750AbWC1HPi (ORCPT ); Tue, 28 Mar 2006 02:15:38 -0500 Subject: Re: [Ext2-devel] [PATCH 2/2] ext2/3: Support2^32-1blocks(e2fsprogs) From: Laurent Vivier To: Ravikiran G Thirumalai Cc: Andrew Morton , Mingming Cao , Takashi Sato , Badari Pulavarty , linux-kernel@vger.kernel.org, ext2-devel In-Reply-To: <20060327225847.GC3756@localhost.localdomain> References: <20060325223358sho@rifu.tnes.nec.co.jp> <1143485147.3970.23.camel@dyn9047017067.beaverton.ibm.com> <20060327131049.2c6a5413.akpm@osdl.org> <20060327225847.GC3756@localhost.localdomain> Message-Id: <1143530126.11560.6.camel@openx2.frec.bull.fr> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-14) Date: Tue, 28 Mar 2006 09:15:26 +0200 X-MIMETrack: Itemize by SMTP Server on ECN002/FR/BULL(Release 5.0.12 |February 13, 2003) at 28/03/2006 09:17:38, Serialize by Router on ECN002/FR/BULL(Release 5.0.12 |February 13, 2003) at 28/03/2006 09:17:41, Serialize complete at 28/03/2006 09:17:41 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-rDAl80msYwzGb80xExnD" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9238 Lines: 169 --=-rDAl80msYwzGb80xExnD Content-Type: multipart/mixed; boundary="=-32eS7SKTfeFb7t8eZRrB" --=-32eS7SKTfeFb7t8eZRrB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le mar 28/03/2006 =C3=A0 00:58, Ravikiran G Thirumalai a =C3=A9crit : > On Mon, Mar 27, 2006 at 01:10:49PM -0800, Andrew Morton wrote: > > Mingming Cao wrote: > > > > > > I am wondering if we have (or plan to have) "long long " type of perc= pu > > > counters? Andrew, Kiran, do you know? =20 > > >=20 > > > It seems right now the percpu counters are used mostly by ext2/3 for > > > filesystem free blocks accounting. Right now the counter is "long" t= ype, > > > which is not enough if we want to extend the filesystem limit from 2= **31 > > > to 2**32 on 32 bit machine. > > >=20 > > > The patch from Takashi copies the whole percpu_count.h and create a= new > > > percpu_llcounter.h to support longlong type percpu counters. I am > > > wondering is there any better way for this? > > >=20 > >=20 > > I can't immediately think of anything smarter. > >=20 > > One could of course implement a 64-bit percpu counter by simply > > concatenating two 32-bit counters. That would be a little less efficie= nt, > > but would introduce less source code and would mean that we don't need = to > > keep two different implemetations in sync. But one would need to do a = bit > > of implementation, see how bad it looks. >=20 > Since long long is 64 bits on both 32bit and 64 bit arches, we can just > change percpu_counter type to long long (or s64) and just have one > implementation of percpu_counter? =20 > But reads and writes on 64 bit counters may not be atomic on all 32 bit a= rches. > So the implementation might have to be reviewed for that. As 64bit per cpu counter is used only by ext3 and needed only on 64bit architecture and when CONFIG_LBD is set, perhaps we can have only one implementation, 32bit in the case of 32bit arch and 64bit in the case of 64bit arch + LBD, as I did in my 64bit patches for ext3 ? Cheers, Laurent --=20 Laurent Vivier Bull, Architect of an Open World (TM) http://www.bullopensource.org/ext4 --=-32eS7SKTfeFb7t8eZRrB Content-Disposition: attachment; filename=percpu.patch Content-Type: text/x-patch; name=percpu.patch; charset=UTF-8 Content-Transfer-Encoding: base64 SW5kZXg6IGxpbnV4LTIuNi4xNi1sdi9pbmNsdWRlL2xpbnV4L3BlcmNwdV9jb3VudGVyLmgNCj09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0NCi0tLSBsaW51eC0yLjYuMTYtbHYub3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sNCisjZWxzZQ0KIGxvbmcgcGVyY3B1X2NvdW50 ZXJfc3VtKHN0cnVjdCBwZXJjcHVfY291bnRlciAqZmJjKQ0KIHsNCiAJbG9uZyByZXQ7DQorI2Vu ZGlmDQogCWludCBjcHU7DQogDQogCXNwaW5fbG9jaygmZmJjLT5sb2NrKTsNCiAJcmV0ID0gZmJj LT5jb3VudDsNCiAJZm9yX2VhY2hfY3B1KGNwdSkgew0KLQkJbG9uZyAqcGNvdW50ID0gcGVyX2Nw dV9wdHIoZmJjLT5jb3VudGVycywgY3B1KTsNCisjaWZkZWYgQ09ORklHX0xCRA0KKwkJbG9uZyBs b25nICpwY291bnQ7DQorI2Vsc2UNCisJCWxvbmcgKnBjb3VudDsNCisjZW5kaWYNCisJCXBjb3Vu dCA9IHBlcl9jcHVfcHRyKGZiYy0+Y291bnRlcnMsIGNwdSk7DQogCQlyZXQgKz0gKnBjb3VudDsN CiAJfQ0KIAlzcGluX3VubG9jaygmZmJjLT5sb2NrKTsNCn== --=-32eS7SKTfeFb7t8eZRrB-- --=-rDAl80msYwzGb80xExnD Content-Type: application/pgp-signature; name=signature.asc Content-Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e=2E?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.7 (GNU/Linux) iD8DBQBEKOKO9Kffa9pFVzwRAgs8AKDAv5hTlNnvmjqQHUoOadJqr/4JJwCeM73Y Mf9czx1Qtx+ptqQRq0/KoEw= =ynFw -----END PGP SIGNATURE----- --=-rDAl80msYwzGb80xExnD-- - 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/