• Hirofumi Ogawa's avatar
    [PATCH] FAT: rewrite the cache for file allocation table lookup · f93a1734
    Hirofumi Ogawa authored
    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: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    f93a1734
fatfs_syms.c 1020 Bytes