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


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.
> 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.


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

Version: GnuPG v1.4.2 (NetBSD)