Re: Speeding up FAT operations

Gordon Chaffee (chaffee@cs.berkeley.edu)
Tue, 15 Sep 1998 14:14:44 -0700 (PDT)


Jukka Tapani Santala writes:
> I'm using egcs-1.0.3 release and Linux 2.1.120 kernel on Pentium II at the
> moment. Every now and then I feel the need to hunt for the most obiviously
> inefficient bit of code in Linux kernel, which usually falls within the
> domain of FAT filesystem drivers... which, I guess, isn't all Linux's
> fault ;) However, my current pet-peewe is the fat_smap() function in
> fs/fat/cache.c - caches are supposed to speed up things, but with lines
> like...
>
> cluster = sector/sb->cluster_size;
> offset = sector % sb->cluster_size;

If you want to make improvements, go ahead and create a patch. The
particular code in question has been around for a long time. It seems
it showed up somewhere in the v1.1.x, and there probably haven't been
many people who have done much looking at that particular code. With
the FAT filesystems, not all that much time is spent trying to improve
their speed. It has usually just been to keep them working reasonably
well with the latest kernel versions. Looking at code again can make
a big difference. For example, I recently made a change in some of
the vfat code that made better use of the dcache, and it improved file
creation time when large numbers of files existed in a directory
dramatically. It isn't in the main kernel yet because I haven't
extracted it from all the other changes I've made.

So I encourage you to fix the things that you think are broken, too
slow, or whatever. That is what makes free software get continually
better.

- Gordon

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/