1. 01 6月, 2018 6 次提交
  2. 30 5月, 2018 4 次提交
  3. 03 5月, 2018 1 次提交
  4. 28 3月, 2018 1 次提交
  5. 17 3月, 2018 2 次提交
  6. 13 3月, 2018 7 次提交
    • C
      f2fs: support hot file extension · b6a06cbb
      Chao Yu 提交于
      This patch supports to recognize hot file extension in f2fs, so that we
      can allocate proper hot segment location for its data, which can lead to
      better hot/cold seperation in filesystem.
      
      In addition, we changes a bit on query/add/del operation method for
      extension_list sysfs entry as below:
      
      - Query: cat /sys/fs/f2fs/<disk>/extension_list
      - Add: echo 'extension' > /sys/fs/f2fs/<disk>/extension_list
      - Del: echo '!extension' > /sys/fs/f2fs/<disk>/extension_list
      - Add: echo '[h/c]extension' > /sys/fs/f2fs/<disk>/extension_list
      - Del: echo '[h/c]!extension' > /sys/fs/f2fs/<disk>/extension_list
      - [h] means add/del hot file extension
      - [c] means add/del cold file extension
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b6a06cbb
    • J
      f2fs: issue discard aggressively in the gc_urgent mode · dee02f0d
      Jaegeuk Kim 提交于
      This patch avoids to skip discard commands when user sets gc_urgent mode.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      dee02f0d
    • J
      f2fs: add mount option for segment allocation policy · 07939627
      Jaegeuk Kim 提交于
      This patch adds an mount option, "alloc_mode=%s" having two options, "default"
      and "reuse".
      
      In "alloc_mode=reuse" case, f2fs starts to allocate segments from 0'th segment
      all the time to reassign segments. It'd be useful for small-sized eMMC parts.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      07939627
    • S
      f2fs: clean up f2fs_sb_has_xxx functions · ccd31cb2
      Sheng Yong 提交于
      This patch introduces F2FS_FEATURE_FUNCS to clean up the definitions of
      different f2fs_sb_has_xxx functions.
      Signed-off-by: NSheng Yong <shengyong1@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ccd31cb2
    • H
      f2fs: support passing down write hints to block layer with F2FS policy · f2e703f9
      Hyunchul Lee 提交于
      Add 'whint_mode=fs-based' mount option. In this mode, F2FS passes
      down write hints with its policy.
      
      * whint_mode=fs-based. F2FS passes down hints with its policy.
      
      User                  F2FS                     Block
      ----                  ----                     -----
                            META                     WRITE_LIFE_MEDIUM;
                            HOT_NODE                 WRITE_LIFE_NOT_SET
                            WARM_NODE                "
                            COLD_NODE                WRITE_LIFE_NONE
      ioctl(COLD)           COLD_DATA                WRITE_LIFE_EXTREME
      extension list        "                        "
      
      -- buffered io
      WRITE_LIFE_EXTREME    COLD_DATA                WRITE_LIFE_EXTREME
      WRITE_LIFE_SHORT      HOT_DATA                 WRITE_LIFE_SHORT
      WRITE_LIFE_NOT_SET    WARM_DATA                WRITE_LIFE_LONG
      WRITE_LIFE_NONE       "                        "
      WRITE_LIFE_MEDIUM     "                        "
      WRITE_LIFE_LONG       "                        "
      
      -- direct io
      WRITE_LIFE_EXTREME    COLD_DATA                WRITE_LIFE_EXTREME
      WRITE_LIFE_SHORT      HOT_DATA                 WRITE_LIFE_SHORT
      WRITE_LIFE_NOT_SET    WARM_DATA                WRITE_LIFE_NOT_SET
      WRITE_LIFE_NONE       "                        WRITE_LIFE_NONE
      WRITE_LIFE_MEDIUM     "                        WRITE_LIFE_MEDIUM
      WRITE_LIFE_LONG       "                        WRITE_LIFE_LONG
      
      Many thanks to Chao Yu and Jaegeuk Kim for comments to
      implement this patch.
      Signed-off-by: NHyunchul Lee <cheol.lee@lge.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      f2e703f9
    • H
      f2fs: support passing down write hints given by users to block layer · 0cdd3195
      Hyunchul Lee 提交于
      Add the 'whint_mode' mount option that controls which write
      hints are passed down to block layer. There are "off" and
      "user-based" mode. The default mode is "off".
      
      1) whint_mode=off. F2FS only passes down WRITE_LIFE_NOT_SET.
      
      2) whint_mode=user-based. F2FS tries to pass down hints given
      by users.
      
      User                  F2FS                     Block
      ----                  ----                     -----
                            META                     WRITE_LIFE_NOT_SET
                            HOT_NODE                 "
                            WARM_NODE                "
                            COLD_NODE                "
      ioctl(COLD)           COLD_DATA                WRITE_LIFE_EXTREME
      extension list        "                        "
      
      -- buffered io
      WRITE_LIFE_EXTREME    COLD_DATA                WRITE_LIFE_EXTREME
      WRITE_LIFE_SHORT      HOT_DATA                 WRITE_LIFE_SHORT
      WRITE_LIFE_NOT_SET    WARM_DATA                WRITE_LIFE_NOT_SET
      WRITE_LIFE_NONE       "                        "
      WRITE_LIFE_MEDIUM     "                        "
      WRITE_LIFE_LONG       "                        "
      
      -- direct io
      WRITE_LIFE_EXTREME    COLD_DATA                WRITE_LIFE_EXTREME
      WRITE_LIFE_SHORT      HOT_DATA                 WRITE_LIFE_SHORT
      WRITE_LIFE_NOT_SET    WARM_DATA                WRITE_LIFE_NOT_SET
      WRITE_LIFE_NONE       "                        WRITE_LIFE_NONE
      WRITE_LIFE_MEDIUM     "                        WRITE_LIFE_MEDIUM
      WRITE_LIFE_LONG       "                        WRITE_LIFE_LONG
      
      Many thanks to Chao Yu and Jaegeuk Kim for comments to
      implement this patch.
      Signed-off-by: NHyunchul Lee <cheol.lee@lge.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      [Jaegeuk Kim: avoid build warning]
      [Chao Yu: fix to restore whint_mode in ->remount_fs]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0cdd3195
    • Y
      f2fs: fix heap mode to reset it back · b94929d9
      Yunlong Song 提交于
      Commit 7a20b8a6 ("f2fs: allocate node
      and hot data in the beginning of partition") introduces another mount
      option, heap, to reset it back. But it does not do anything for heap
      mode, so fix it.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NYunlong Song <yunlong.song@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      b94929d9
  7. 26 1月, 2018 3 次提交
    • 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
  8. 23 1月, 2018 1 次提交
  9. 19 1月, 2018 1 次提交
  10. 17 1月, 2018 3 次提交
    • C
      f2fs: avoid high cpu usage in discard thread · 49c60c67
      Chao Yu 提交于
      We take very long time to finish generic/476, this is because we will
      check consistence of all discard entries in global rb tree while
      traversing all different granularity pending lists, even when the list
      is empty, in order to avoid that unneeded overhead, we have to skip
      the check when coming up an empty list.
      
      generic/476 time consumption:
      					cost
      Before patch & w/o consistence check	57s
      Before patch & w/ consistence check	1426s
      After patch				78s
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      49c60c67
    • W
      f2fs: make local functions static · 94b1e10e
      Wei Yongjun 提交于
      Fixes the following sparse warnings:
      
      fs/f2fs/segment.c:887:6: warning:
       symbol '__check_sit_bitmap' was not declared. Should it be static?
      fs/f2fs/segment.c:1327:6: warning:
       symbol 'f2fs_wait_discard_bio' was not declared. Should it be static?
      fs/f2fs/super.c:1661:5: warning:
       symbol 'f2fs_get_projid' was not declared. Should it be static?
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      94b1e10e
    • Y
      f2fs: check segment type in __f2fs_replace_block · 2c190504
      Yunlong Song 提交于
      In some case, the node blocks has wrong blkaddr whose segment type is
      NODE, e.g., recover inode has missing xattr flag and the blkaddr is in
      the xattr range. Since fsck.f2fs does not check the recovery nodes, this
      will cause __f2fs_replace_block change the curseg of node and do the
      update_sit_entry(sbi, new_blkaddr, 1) with no next_blkoff refresh, as a
      result, when recovery process write checkpoint and sync nodes, the
      next_blkoff of curseg is used in the segment bit map, then it will
      cause f2fs_bug_on. So let's check segment type in __f2fs_replace_block.
      Signed-off-by: NYunlong Song <yunlong.song@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      2c190504
  11. 03 1月, 2018 5 次提交
  12. 10 11月, 2017 1 次提交
  13. 06 11月, 2017 5 次提交
    • C
      f2fs: fix summary info corruption · 2b60311d
      Chao Yu 提交于
      Sometimes, after running generic/270 of fstest, fsck reports summary
      info and actual position of block address in direct node becoming
      inconsistent.
      
      The root cause is race in between __f2fs_replace_block and change_curseg
      as below:
      
      Thread A				Thread B
      - __clone_blkaddrs
       - f2fs_replace_block
        - __f2fs_replace_block
         - segnoA = GET_SEGNO(sbi, blkaddrA);
         - type = se->type:=CURSEG_HOT_DATA
         - if (!IS_CURSEG(sbi, segnoA))
               type = CURSEG_WARM_DATA
      					- allocate_data_block
      					 - allocate_segment
      					  - get_ssr_segment
      					  - change_curseg(segnoA, CURSEG_HOT_DATA)
         - change_curseg(segnoA, CURSEG_WARM_DATA)
          - reset_curseg
           - __set_sit_entry_type
            - change se->type from CURSEG_HOT_DATA to CURSEG_WARM_DATA
      
      So finally, hot curseg locates in segnoA, but type of segnoA becomes
      CURSEG_WARM_DATA.
      
      Then if we invoke __f2fs_replace_block(blkaddrB, blkaddrA, true, false),
      as blkaddrA locates in segnoA, so we will move warm type curseg to segnoA,
      then change its summary cache and writeback it to summary block.
      
      But segnoA is used by hot type curseg too, once it moves or persist, it
      will cover summary block content with inner old summary cache, result in
      inconsistent status.
      
      This patch tries to fix this issue by introduce global curseg lock to avoid
      race in between __f2fs_replace_block and change_curseg.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      2b60311d
    • C
      f2fs: remove dead code in update_meta_page · 0537b811
      Chao Yu 提交于
      After commit a468f0ef ("f2fs: use crc and cp version to determine
      roll-forward recovery"), last caller of update_meta_page passing @src
      with NULL is gone, so remove related dead code there.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0537b811
    • C
      f2fs: use rw_semaphore to protect SIT cache · 3d26fa6b
      Chao Yu 提交于
      There are some cases user didn't update SIT cache under this lock,
      so let's use rw_semaphore instead of mutex to enhance concurrently
      accessing.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      3d26fa6b
    • Y
      Revert "f2fs: handle dirty segments inside refresh_sit_entry" · 65f1b80b
      Yunlong Song 提交于
      This reverts commit 5e443818
      
      The commit should be reverted because call sequence of below two parts
      of code must be kept:
      a. update sit information, it needs to be updated before segment
      allocation since latter allocation may trigger SSR, and SSR allocation
      needs latest valid block information of all segments.
      b. update segment status, it needs to be updated after segment allocation
      since we can skip updating current opened segment status.
      
      Fixes: 5e443818 ("f2fs: handle dirty segments inside refresh_sit_entry")
      Suggested-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NYunlong Song <yunlong.song@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      [Jaegeuk Kim: remove refresh_sit_entry function]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      65f1b80b
    • C
      f2fs: export SSR allocation threshold · a2a12b67
      Chao Yu 提交于
      This patch exports min_ssr_segments threshold in sysfs to let user
      control triggering SSR allocation flexibly.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      a2a12b67