]> git.hungrycats.org Git - linux/commit
[PATCH] FAT: rewrite the cache for file allocation table lookup
authorHirofumi Ogawa <hirofumi@mail.parknet.co.jp>
Wed, 20 Oct 2004 01:15:04 +0000 (18:15 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 20 Oct 2004 01:15:04 +0000 (18:15 -0700)
commitf93a17341607ea8e03c047ca123871989b1da280
tree99437f20d48c338abbbd1eb7143de011caeb5e68
parent13f17cb5b700b2aa5ee54c8d6e248ccc97ce3511
[PATCH] FAT: rewrite the cache for file allocation table lookup

This rewrites the cache stuff for file allocation table (FAT).

This cache stocks the more pieces of FAT-chain by counting the number
of contiguous data blocks. And if cache hit, since a block number can
calculate without looking FAT-chain up, fat_get_block() become more
fast.

But if data blocks was fragmenting, unfortunately this cache is unuseful.

read from block device

[1st]# time dd if=/dev/hda6 of=/dev/null bs=1M count=2048
2147483648 bytes transferred in 229.524189 seconds (9356241 bytes/sec)
real    3m49.557s, user    0m0.026s, sys     1m20.414s
[2nd]# time dd if=/dev/hda6 of=/dev/null bs=1M count=2048
2147483648 bytes transferred in 229.539358 seconds (9355623 bytes/sec)
real    3m49.647s, user    0m0.036s, sys     1m20.144s

read from full contiguous file with this patch

[1st]# time dd if=data of=/dev/null bs=1M count=2048
2147483648 bytes transferred in 337.959477 seconds (6354264 bytes/sec)
real    5m37.970s, user    0m0.031s, sys     1m21.915s
[2nd]# time dd if=data of=/dev/null bs=1M count=2048
2147483648 bytes transferred in 225.401699 seconds (9527362 bytes/sec)
real    3m45.476s, user    0m0.027s, sys     1m19.286s

read from full fragmented file with this patch

[1st]# time dd if=data of=/dev/null bs=1M count=2048
2147483647 bytes transferred in 1146.529081 seconds (1873030 bytes/sec)
real    19m6.538s, user    0m0.020s, sys     1m32.774s
[2nd]# time dd if=data of=/dev/null bs=1M count=2048
2147483647 bytes transferred in 1045.084822 seconds (2054841 bytes/sec)
real    17m25.152s, user    0m0.022s, sys     1m34.801s

read from full contiguous file without this patch

[1st]# time dd if=data of=/dev/null bs=1M count=2048
2147483648 bytes transferred in 348.144707 seconds (6168365 bytes/sec)
real    5m48.169s, user    0m0.019s, sys     1m29.962s
[2nd]# time dd if=data of=/dev/null bs=1M count=2048
2147483648 bytes transferred in 324.017361 seconds (6627681 bytes/sec)
real    5m24.038s, user    0m0.023s, sys     1m20.602s

read from full fragmented file without this patch

[1st]# time dd if=data of=/dev/null bs=1M count=2048
2147483647 bytes transferred in 1156.845693 seconds (1856327 bytes/sec)
real    19m16.855s, user    0m0.031s, sys     1m32.172s
[2nd]# time dd if=data of=/dev/null bs=1M count=2048
2147483647 bytes transferred in 1066.518713 seconds (2013545 bytes/sec)
real    17m46.526s, user    0m0.023s, sys     1m33.630s

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/fat/cache.c
fs/fat/fatfs_syms.c
fs/fat/inode.c
fs/fat/misc.c
include/linux/msdos_fs.h
include/linux/msdos_fs_i.h
include/linux/msdos_fs_sb.h