1. 04 7月, 2017 2 次提交
    • C
      f2fs: fix to avoid panic when encountering corrupt node · 1f258ec1
      Chao Yu 提交于
      With fault_injection option, generic/361 of fstests will complain us
      with below message:
      
      Call Trace:
       get_node_page+0x12/0x20 [f2fs]
       f2fs_iget+0x92/0x7d0 [f2fs]
       f2fs_fill_super+0x10fb/0x15e0 [f2fs]
       mount_bdev+0x184/0x1c0
       f2fs_mount+0x15/0x20 [f2fs]
       mount_fs+0x39/0x150
       vfs_kern_mount+0x67/0x110
       do_mount+0x1bb/0xc70
       SyS_mount+0x83/0xd0
       do_syscall_64+0x6e/0x160
       entry_SYSCALL64_slow_path+0x25/0x25
      
      Since mkfs loop device in f2fs partition can be failed silently due to
      checkpoint error injection, so root inode page can be corrupted, in order
      to avoid needless panic, in get_node_page, it's better to leave message
      and return error to caller, and let fsck repaire it later.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      1f258ec1
    • C
      f2fs: don't track newly allocated nat entry in list · febeca6d
      Chao Yu 提交于
      We will never persist newly allocated nat entries during checkpoint(), so
      we don't need to track such nat entries in nat dirty list in order to
      avoid:
      - more latency during traversing dirty list;
      - sorting nat sets incorrectly due to recording wrong entry_cnt in nat
      entry set.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      febeca6d
  2. 24 5月, 2017 2 次提交
  3. 04 5月, 2017 1 次提交
  4. 26 4月, 2017 1 次提交
  5. 13 4月, 2017 1 次提交
  6. 11 4月, 2017 1 次提交
    • T
      f2fs: guard macro variables with braces · 68afcf2d
      Tomohiro Kusumi 提交于
      Add braces around variables used within macros for those make sense
      to do it. Many of the macros in f2fs already do this. What this commit
      doesn't do is anything that changes line# as a result of adding braces,
      which usually affects the binary via __LINE__.
      
      Confirmed no diff in fs/f2fs/f2fs.ko before/after this commit on x86_64,
      to make sure this has no functional change as well as there's been no
      unexpected side effect due to callers' arithmetics within the existing
      code.
      Signed-off-by: NTomohiro Kusumi <tkusumi@tuxera.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      68afcf2d
  7. 25 3月, 2017 2 次提交
  8. 22 3月, 2017 3 次提交
  9. 20 3月, 2017 4 次提交
    • C
      f2fs: combine nat_bits and free_nid_bitmap cache · 7041d5d2
      Chao Yu 提交于
      Both nat_bits cache and free_nid_bitmap cache provide same functionality
      as a intermediate cache between free nid cache and disk, but with
      different granularity of indicating free nid range, and different
      persistence policy. nat_bits cache provides better persistence ability,
      and free_nid_bitmap provides better granularity.
      
      In this patch we combine advantage of both caches, so finally policy of
      the intermediate cache would be:
      - init: load free nid status from nat_bits into free_nid_bitmap
      - lookup: scan free_nid_bitmap before load NAT blocks
      - update: update free_nid_bitmap in real-time
      - persistence: udpate and persist nat_bits in checkpoint
      
      This patch also resolves performance regression reported by lkp-robot.
      
      commit:
        4ac91242 ("f2fs: introduce free nid bitmap")
        d00030cf9cd0bb96fdccc41e33d3c91dcbb672ba ("f2fs: use __set{__clear}_bit_le")
        1382c0f3f9d3f936c8bc42ed1591cf7a593ef9f7 ("f2fs: combine nat_bits and free_nid_bitmap cache")
      
      4ac91242 d00030cf9cd0bb96fdccc41e33 1382c0f3f9d3f936c8bc42ed15
      ---------------- -------------------------- --------------------------
               %stddev     %change         %stddev     %change         %stddev
                   \          |                \          |                \
           77863 ±  0%      +2.1%      79485 ±  1%     +50.8%     117404 ±  0%  aim7.jobs-per-min
          231.63 ±  0%      -2.0%     227.01 ±  1%     -33.6%     153.80 ±  0%  aim7.time.elapsed_time
          231.63 ±  0%      -2.0%     227.01 ±  1%     -33.6%     153.80 ±  0%  aim7.time.elapsed_time.max
          896604 ±  0%      -0.8%     889221 ±  3%     -20.2%     715260 ±  1%  aim7.time.involuntary_context_switches
            2394 ±  1%      +4.6%       2503 ±  1%      +3.7%       2481 ±  2%  aim7.time.maximum_resident_set_size
            6240 ±  0%      -1.5%       6145 ±  1%     -14.1%       5360 ±  1%  aim7.time.system_time
         1111357 ±  3%      +1.9%    1132509 ±  2%      -6.2%    1041932 ±  2%  aim7.time.voluntary_context_switches
      ...
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Tested-by: NXiaolong Ye <xiaolong.ye@intel.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      7041d5d2
    • C
      f2fs: skip scanning free nid bitmap of full NAT blocks · 586d1492
      Chao Yu 提交于
      This patch adds to account free nids for each NAT blocks, and while
      scanning all free nid bitmap, do check count and skip lookuping in
      full NAT block.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      586d1492
    • J
      f2fs: use __set{__clear}_bit_le · 23380b85
      Jaegeuk Kim 提交于
      This patch uses __set{__clear}_bit_le for highter speed.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      23380b85
    • J
      f2fs: declare static functions · 9f7e4a2c
      Jaegeuk Kim 提交于
      This is to avoid build warning reported by kbuild test robot.
      Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      9f7e4a2c
  10. 01 3月, 2017 1 次提交
  11. 28 2月, 2017 5 次提交
  12. 24 2月, 2017 6 次提交
  13. 23 2月, 2017 1 次提交
  14. 29 1月, 2017 1 次提交
  15. 26 11月, 2016 2 次提交
    • C
      f2fs: fix to account total free nid correctly · 04d47e67
      Chao Yu 提交于
      Thread A		Thread B		Thread C
      - f2fs_create
       - f2fs_new_inode
        - f2fs_lock_op
         - alloc_nid
          alloc last nid
        - f2fs_unlock_op
      			- f2fs_create
      			 - f2fs_new_inode
      			  - f2fs_lock_op
      			   - alloc_nid
      			    as node count still not
      			    be increased, we will
      			    loop in alloc_nid
      						- f2fs_write_node_pages
      						 - f2fs_balance_fs_bg
      						  - f2fs_sync_fs
      						   - write_checkpoint
      						    - block_operations
      						     - f2fs_lock_all
       - f2fs_lock_op
      
      While creating new inode, we do not allocate and account nid atomically,
      so that when there is almost no free nids left, we may encounter deadloop
      like above stack.
      
      In order to avoid that, reuse nm_i::available_nids for accounting free nids
      and make nid allocation and counting being atomical during node creation.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      04d47e67
    • Y
      f2fs: fix an infinite loop when flush nodes in cp · d40a43af
      Yunlei He 提交于
      Thread A			Thread B
      
      - write_checkpoint
       - block_operations
         -blk_start_plug
          -sync_node_pages		- f2fs_do_sync_file
      				 - fsync_node_pages
      				  - f2fs_wait_on_page_writeback
      
      Thread A wait for global F2FS_DIRTY_NODES decreased to zero,
      it start a plug list, some requests have been added to this list.
      Thread B lock one dirty node page, and wait this page write back.
      But this page has been in plug list of thread A with PG_writeback flag.
      Thread A keep on running and its plug list has no chance to finish,
      so it seems a deadlock between cp and fsync path.
      
      This patch add a wait on page write back before set node page dirty
      to avoid this problem.
      Signed-off-by: NYunlei He <heyunlei@huawei.com>
      Signed-off-by: NPengyang Hou <houpengyang@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d40a43af
  16. 24 11月, 2016 7 次提交