1. 26 1月, 2018 4 次提交
    • Y
      f2fs: rebuild sit page from sit info in mem · 068c3cd8
      Yunlei He 提交于
      This patch rebuild sit page from sit info in mem instead
      of issue a read io.
      
      I test this method and the result is as below:
      
      Pre:
       mmc_perf_test-12061 [001] ...1   976.819992: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
       mmc_perf_test-12061 [001] ...1   976.856446: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
       mmc_perf_test-12061 [003] ...1   998.976946: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
       mmc_perf_test-12061 [003] ...1   999.023269: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
       mmc_perf_test-12061 [003] ...1  1022.060772: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
       mmc_perf_test-12061 [003] ...1  1022.111034: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
       mmc_perf_test-12061 [002] ...1  1070.127643: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
       mmc_perf_test-12061 [003] ...1  1070.187352: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
       mmc_perf_test-12061 [003] ...1  1095.942124: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
       mmc_perf_test-12061 [003] ...1  1095.995975: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
       mmc_perf_test-12061 [003] ...1  1122.535091: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
       mmc_perf_test-12061 [003] ...1  1122.586521: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
       mmc_perf_test-12061 [001] ...1  1147.897487: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
       mmc_perf_test-12061 [001] ...1  1147.959438: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
       mmc_perf_test-12061 [003] ...1  1177.926951: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
       mmc_perf_test-12061 [002] ...1  1177.976823: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
       mmc_perf_test-12061 [002] ...1  1204.176087: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
       mmc_perf_test-12061 [002] ...1  1204.239046: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      
      Some sit flush consume more than 50ms.
      
      Now:
      mmc_perf_test-2187  [007] ...1   196.840684: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [007] ...1   196.841258: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      mmc_perf_test-2187  [007] ...1   219.430582: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [007] ...1   219.431144: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      mmc_perf_test-2187  [002] ...1   243.638678: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [000] ...1   243.638980: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      mmc_perf_test-2187  [002] ...1   265.392180: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [002] ...1   265.392245: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      mmc_perf_test-2187  [000] ...1   290.309051: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [000] ...1   290.309116: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      mmc_perf_test-2187  [003] ...1   317.144209: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [003] ...1   317.145913: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      mmc_perf_test-2187  [005] ...1   343.224954: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [005] ...1   343.225574: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      mmc_perf_test-2187  [000] ...1   370.239846: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [000] ...1   370.241138: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      mmc_perf_test-2187  [001] ...1   397.029043: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [001] ...1   397.030750: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      mmc_perf_test-2187  [003] ...1   425.386377: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = start flush sit
      mmc_perf_test-2187  [003] ...1   425.387735: f2fs_write_checkpoint: dev = (259,44), checkpoint for Sync, state = end flush sit
      
      Most sit flush consume no more than 1ms.
      Signed-off-by: NYunlei He <heyunlei@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      068c3cd8
    • C
      f2fs: stop issuing discard if fs is readonly · 3b60d802
      Chao Yu 提交于
      If filesystem is readonly, stop to issue discard in daemon.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      3b60d802
    • C
      f2fs: clean up duplicated assignment in init_discard_policy · 6819b884
      Chao Yu 提交于
      Remove duplicated codes of assignment for .max_requests and .io_aware_gran.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6819b884
    • C
      f2fs: use GFP_F2FS_ZERO for cleanup · 2882d343
      Chao Yu 提交于
      Clean up codes with GFP_F2FS_ZERO, no logic changes.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      2882d343
  2. 23 1月, 2018 16 次提交
    • J
      f2fs: allow to recover node blocks given updated checkpoint · f2367923
      Jaegeuk Kim 提交于
      If fsck.f2fs changes crc, we have no way to recover some inode blocks by roll-
      forward recovery. Let's relax the condition to recover them.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      f2367923
    • J
      f2fs: recover some i_inline flags · 37a086f0
      Jaegeuk Kim 提交于
      This fixes lost i_inline flags during roll-forward.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      37a086f0
    • D
      f2fs: correct removexattr behavior for null valued extended attribute · b2c4692b
      Daeho Jeong 提交于
      __vfs_removexattr() transfers "NULL" value to the setxattr handler of
      the f2fs filesystem in order to remove the extended attribute. But,
      __f2fs_setxattr() just ignores the removal request when the value of
      the extended attribute is already NULL. We have to remove the extended
      attribute itself even if the value of that is already NULL.
      
      We can reporduce this bug with the below:
      
      1. touch file
      2. setfattr -n "user.foo" file
      3. setfattr -x "user.foo" file
      4. getfattr -d file
      > user.foo
      Signed-off-by: NDaeho Jeong <daeho.jeong@samsung.com>
      Signed-off-by: NYoungjin Gil <youngjin.gil@samsung.com>
      Tested-by: NHobin Woo <hobin.woo@samsung.com>
      Tested-by: NChao Yu <yuchao0@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b2c4692b
    • C
      f2fs: drop page cache after fs shutdown · db198ae0
      Chao Yu 提交于
      Don't remain dirtied page cache in f2fs after shutdown, it can mitigate
      memory pressure of whole system, in order to keep other modules working
      properly.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      db198ae0
    • C
      f2fs: stop gc/discard thread after fs shutdown · 7950e9ac
      Chao Yu 提交于
      Once filesystem shuts down, daemons like gc/discard thread should be
      aware of it, and do exit, in addtion, drop all cached pending discard
      commands and turn off real-time discard mode.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      7950e9ac
    • C
      f2fs: hanlde error case in f2fs_ioc_shutdown · d027c484
      Chao Yu 提交于
      This patch makes f2fs_ioc_shutdown handling error case correctly.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d027c484
    • C
      f2fs: split need_inplace_update · bb9e3bb8
      Chao Yu 提交于
      This patch splits need_inplace_update to two functions:
      a. should_update_inplace() includes all conditions that we must use IPU.
      b. should_update_outplace() includes all conditions that we must use OPU.
      
      So that, in f2fs_ioc_set_pin_file() and f2fs_defragment_range(), we can
      use corresponding function to check whether we can trigger OPU/IPU or not.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      bb9e3bb8
    • C
      f2fs: fix to update last_disk_size correctly · eb449797
      Chao Yu 提交于
      This patch fixes to update last_disk_size only when writing out page
      successfully.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      eb449797
    • C
      f2fs: kill F2FS_INLINE_XATTR_ADDRS for cleanup · b323fd28
      Chao Yu 提交于
      Use get_inline_xattr_addrs directly instead of F2FS_INLINE_XATTR_ADDRS.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b323fd28
    • C
      f2fs: clean up error path of fill_super · d7997e63
      Chao Yu 提交于
      This patch cleans up error path of fille_super to avoid unneeded
      release step.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d7997e63
    • S
      f2fs: avoid hungtask when GC encrypted block if io_bits is set · a9d572c7
      Sheng Yong 提交于
      When io_bits is set, GCing encrypted block may hit the following hungtask.
      Since io_bits requires aligned block address, f2fs_submit_page_write may
      return -EAGAIN if new_blkaddr does not satisify io_bits alignment. As a
      result, the encrypted page will never be writtenback.
      
      This patch makes move_data_block aware the EAGAIN error and cancel the
      writeback.
      
      [  246.751371] INFO: task kworker/u4:4:797 blocked for more than 90 seconds.
      [  246.752423]       Not tainted 4.15.0-rc4+ #11
      [  246.754176] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      [  246.755336] kworker/u4:4    D25448   797      2 0x80000000
      [  246.755597] Workqueue: writeback wb_workfn (flush-7:0)
      [  246.755616] Call Trace:
      [  246.755695]  ? __schedule+0x322/0xa90
      [  246.755761]  ? blk_init_request_from_bio+0x120/0x120
      [  246.755773]  ? pci_mmcfg_check_reserved+0xb0/0xb0
      [  246.755801]  ? __radix_tree_create+0x19e/0x200
      [  246.755813]  ? delete_node+0x136/0x370
      [  246.755838]  schedule+0x43/0xc0
      [  246.755904]  io_schedule+0x17/0x40
      [  246.755939]  wait_on_page_bit_common+0x17b/0x240
      [  246.755950]  ? wake_page_function+0xa0/0xa0
      [  246.755961]  ? add_to_page_cache_lru+0x160/0x160
      [  246.755972]  ? page_cache_tree_insert+0x170/0x170
      [  246.755983]  ? __lru_cache_add+0x96/0xb0
      [  246.756086]  __filemap_fdatawait_range+0x14f/0x1c0
      [  246.756097]  ? wait_on_page_bit_common+0x240/0x240
      [  246.756120]  ? __wake_up_locked_key_bookmark+0x20/0x20
      [  246.756167]  ? wait_on_all_pages_writeback+0xc9/0x100
      [  246.756179]  ? __remove_ino_entry+0x120/0x120
      [  246.756192]  ? wait_woken+0x100/0x100
      [  246.756204]  filemap_fdatawait_range+0x9/0x20
      [  246.756216]  write_checkpoint+0x18a1/0x1f00
      [  246.756254]  ? blk_get_request+0x10/0x10
      [  246.756265]  ? cpumask_next_and+0x43/0x60
      [  246.756279]  ? f2fs_sync_inode_meta+0x160/0x160
      [  246.756289]  ? remove_element.isra.4+0xa0/0xa0
      [  246.756300]  ? __put_compound_page+0x40/0x40
      [  246.756310]  ? f2fs_sync_fs+0xec/0x1c0
      [  246.756320]  ? f2fs_sync_fs+0x120/0x1c0
      [  246.756329]  f2fs_sync_fs+0x120/0x1c0
      [  246.756357]  ? trace_event_raw_event_f2fs__page+0x260/0x260
      [  246.756393]  ? ata_build_rw_tf+0x173/0x410
      [  246.756397]  f2fs_balance_fs_bg+0x198/0x390
      [  246.756405]  ? drop_inmem_page+0x230/0x230
      [  246.756415]  ? ahci_qc_prep+0x1bb/0x2e0
      [  246.756418]  ? ahci_qc_issue+0x1df/0x290
      [  246.756422]  ? __accumulate_pelt_segments+0x42/0xd0
      [  246.756426]  ? f2fs_write_node_pages+0xd1/0x380
      [  246.756429]  f2fs_write_node_pages+0xd1/0x380
      [  246.756437]  ? sync_node_pages+0x8f0/0x8f0
      [  246.756440]  ? update_curr+0x53/0x220
      [  246.756444]  ? __accumulate_pelt_segments+0xa2/0xd0
      [  246.756448]  ? __update_load_avg_se.isra.39+0x349/0x360
      [  246.756452]  ? do_writepages+0x2a/0xa0
      [  246.756456]  do_writepages+0x2a/0xa0
      [  246.756460]  __writeback_single_inode+0x70/0x490
      [  246.756463]  ? check_preempt_wakeup+0x199/0x310
      [  246.756467]  writeback_sb_inodes+0x2a2/0x660
      [  246.756471]  ? is_empty_dir_inode+0x40/0x40
      [  246.756474]  ? __writeback_single_inode+0x490/0x490
      [  246.756477]  ? string+0xbf/0xf0
      [  246.756480]  ? down_read_trylock+0x35/0x60
      [  246.756484]  __writeback_inodes_wb+0x9f/0xf0
      [  246.756488]  wb_writeback+0x41d/0x4b0
      [  246.756492]  ? writeback_inodes_wb.constprop.55+0x150/0x150
      [  246.756498]  ? set_worker_desc+0xf7/0x130
      [  246.756502]  ? current_is_workqueue_rescuer+0x60/0x60
      [  246.756511]  ? _find_next_bit+0x2c/0xa0
      [  246.756514]  ? wb_workfn+0x400/0x5d0
      [  246.756518]  wb_workfn+0x400/0x5d0
      [  246.756521]  ? finish_task_switch+0xdf/0x2a0
      [  246.756525]  ? inode_wait_for_writeback+0x30/0x30
      [  246.756529]  process_one_work+0x3a7/0x6f0
      [  246.756533]  worker_thread+0x82/0x750
      [  246.756537]  kthread+0x16f/0x1c0
      [  246.756541]  ? trace_event_raw_event_workqueue_work+0x110/0x110
      [  246.756544]  ? kthread_create_worker_on_cpu+0xb0/0xb0
      [  246.756548]  ret_from_fork+0x1f/0x30
      Signed-off-by: NSheng Yong <shengyong1@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      a9d572c7
    • J
      f2fs: allow quota to use reserved blocks · d8a9a229
      Jaegeuk Kim 提交于
      This patch allows quota to use reserved blocks all the time.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d8a9a229
    • C
      f2fs: fix to drop all inmem pages correctly · a2e2e76b
      Chao Yu 提交于
      In commit 57864ae5 ("f2fs: limit # of inmemory pages"), we have
      limited memory footprint of all inmem pages with 20% of total memory,
      otherwise, if we exceed the threshold, we will try to drop all inmem
      pages to avoid excessive memory pressure resulting in performance
      regression.
      
      But in some unrelated error paths, we will also drop all inmem pages,
      which should be wrong, fix it in this patch.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      a2e2e76b
    • C
      f2fs: speed up defragment on sparse file · f3d98e74
      Chao Yu 提交于
      We have supported to get next page offset with valid mapping crossing
      hole in f2fs_map_blocks, utilizing it to speed up defragment on sparse
      file.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      f3d98e74
    • C
      f2fs: support F2FS_IOC_PRECACHE_EXTENTS · c4020b2d
      Chao Yu 提交于
      This patch introduces a new ioctl F2FS_IOC_PRECACHE_EXTENTS to precache
      extent info like ext4, in order to gain better performance during
      triggering AIO by eliminating synchronous waiting of mapping info.
      
      Referred commit: 7869a4a6 ("ext4: add support for extent pre-caching")
      
      In addition, with newly added extent precache abilitiy, this patch add
      to support FIEMAP_FLAG_CACHE in ->fiemap.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      c4020b2d
    • J
      f2fs: add an ioctl to disable GC for specific file · 1ad71a27
      Jaegeuk Kim 提交于
      This patch gives a flag to disable GC on given file, which would be useful, when
      user wants to keep its block map. It also conducts in-place-update for dontmove
      file.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      1ad71a27
  3. 19 1月, 2018 6 次提交
  4. 17 1月, 2018 9 次提交
  5. 04 1月, 2018 3 次提交
  6. 03 1月, 2018 2 次提交