• Fengnan Chang's avatar
    f2fs: compress: fix overwrite may reduce compress ratio unproperly · b368cc5e
    Fengnan Chang authored
    when overwrite only first block of cluster, since cluster is not full, it
    will call f2fs_write_raw_pages when f2fs_write_multi_pages, and cause the
    whole cluster become uncompressed eventhough data can be compressed.
    this may will make random write bench score reduce a lot.
    
    root# dd if=/dev/zero of=./fio-test bs=1M count=1
    
    root# sync
    
    root# echo 3 > /proc/sys/vm/drop_caches
    
    root# f2fs_io get_cblocks ./fio-test
    
    root# dd if=/dev/zero of=./fio-test bs=4K count=1 oflag=direct conv=notrunc
    
    w/o patch:
    root# f2fs_io get_cblocks ./fio-test
    189
    
    w/ patch:
    root# f2fs_io get_cblocks ./fio-test
    192
    Signed-off-by: default avatarFengnan Chang <changfengnan@vivo.com>
    Signed-off-by: default avatarChao Yu <chao@kernel.org>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    b368cc5e
f2fs.h 142 KB