Subject: Re: msdosfs performance problem
To: Michael van Elst <mlelstv@serpens.de>
From: Tonnerre LOMBARD <tonnerre@thundrix.ch>
List: tech-kern
Date: 11/27/2005 12:48:43
--dTy3Mrz/UPE2dbVg
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Salut,

On Sun, Nov 27, 2005 at 11:39:18AM +0000, Michael van Elst wrote:
> >That may be partially related to fatfs's weird cluster mapping
> >algorithm.
>=20
> Please explain.

fatfs uses "clusters" for addressing everything on the disk, which are
always as many blocks as can be fit into their addressing variables,
which are in case of FAT32 28 bit long. (Yes, very obvious ;)

If you want to touch a cluster on the disk in any way, you have to walk
almost their entire disk structure until finally you reach the cluster
you want. The boot sector thereby contains the cluster number of the
FAT, the FAT contains the cluster number of the root directory, the root
directory contains the cluster number of the first cluster of the file,
and from then on you have a linked list of clusters following each
other. I can't say I'm surprised that this works so poorly.

Also, the block remapping algorithm used by 10'000 cycle flash devices
exist for that exact reason: when writing to a fatfs, there are some
sectors that are always overwritten and thus will reach their 10'000
write cycles much earlier than the rest of the disk.

			    Tonnerre

--dTy3Mrz/UPE2dbVg
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)

iD8DBQFDiZ0bXUVlAbfmNMIRAv3BAKDUFchmciYQV9W5lTNZXHJTZsQjHQCgmTUE
BBgeynfsWvllm/M0KCGw3mo=
=VbL6
-----END PGP SIGNATURE-----

--dTy3Mrz/UPE2dbVg--