Skip to content
  • Jaegeuk Kim's avatar
    f2fs: merge more bios of node block writes · 423e95cc
    Jaegeuk Kim authored
    
    
    Previously, we experience bio traces as follows when running simple sequential
    write test.
    
     f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500104928, size = 4K
     f2fs_do_submit_bio: type = NODE, io = no sync, sector = 499922208, size = 368K
     f2fs_do_submit_bio: type = NODE, io = no sync, sector = 499914752, size = 140K
    
     -> total 512K
    
    The first one is to write an indirect node block, and the others are to write
    direct node blocks.
    
    The reason why there are two separate bios for direct node blocks is:
    0. initial state
    ------------------    ------------------
    |                |    |xxxxxxxx        |
    ------------------    ------------------
    
    1. write 368K
    ------------------    ------------------
    |                |    |xxxxxxxxWWWWWWWW|
    ------------------    ------------------
    
    2. write 140K
    ------------------    ------------------
    |WWWWWWW         |    |xxxxxxxxWWWWWWWW|
    ------------------    ------------------
    
    This is because f2fs_write_node_pages tries to write just 512K totally, so that
    we can lose the chance to merge more bios nicely.
    
    After this patch is applied, we can get the following bio traces.
    
      f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500103168, size = 8K
      f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500111368, size = 4K
      f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500107272, size = 512K
      f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500108296, size = 512K
      f2fs_do_submit_bio: type = NODE, io = no sync, sector = 500109320, size = 500K
    
    And finally, we can improve the sequential write performance,
        from 458.775 MB/s to 479.945 MB/s on SSD.
    
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
    423e95cc