1. 28 3月, 2018 1 次提交
  2. 17 3月, 2018 2 次提交
  3. 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
  4. 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
  5. 23 1月, 2018 1 次提交
  6. 19 1月, 2018 1 次提交
  7. 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
  8. 03 1月, 2018 5 次提交
  9. 10 11月, 2017 1 次提交
  10. 06 11月, 2017 7 次提交
  11. 26 10月, 2017 8 次提交
    • C
      f2fs: remove several redundant assignments · dca6951f
      Colin Ian King 提交于
      There are several assignments to variables that are redundant
      as the values are never read when the variables are updated later
      and so the redundant statements can be safely removed.
      
      Cleans up clang warnings:
      fs/f2fs/segment.c:923:19: warning: Value stored to 'p' during its initialization is never read
      fs/f2fs/segment.c:2060:2: warning: Value stored to 'hint' is never read
      fs/f2fs/segment.c:2353:2: warning: Value stored to 'start_block' is never read
      fs/f2fs/segment.c:2354:2: warning: Value stored to 'end_block' is never read
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      dca6951f
    • J
      f2fs: limit # of inmemory pages · 57864ae5
      Jaegeuk Kim 提交于
      If some abnormal users try lots of atomic write operations, f2fs is able to
      produce pinned pages in the main memory which affects system performance.
      This patch limits that as 20% over total memory size, and if f2fs reaches
      to the limit, it will drop all the inmemory pages.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      57864ae5
    • C
      f2fs: give up CP_TRIMMED_FLAG if it drops discards · cf5c759f
      Chao Yu 提交于
      In ->umount, once we drop remained discard entries, we should not
      set CP_TRIMMED_FLAG with another checkpoint.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      cf5c759f
    • C
      f2fs: trace f2fs_remove_discard · 2ec6f2ef
      Chao Yu 提交于
      This patch adds tracepoint to trace f2fs_remove_discard.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      2ec6f2ef
    • C
      f2fs: reduce cmd_lock coverage in __issue_discard_cmd · 33da62cf
      Chao Yu 提交于
      __submit_discard_cmd may lead long latency due to exhaustion of I/O
      request resource in block layer, so issuing all discard under cmd_lock
      may lead to hangtask, in order to avoid that, let's reduce it's coverage.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      33da62cf
    • C
      f2fs: split discard policy · 78997b56
      Chao Yu 提交于
      There are many different scenarios such as fstrim, umount, urgent or
      background where we will issue discards, actually, they need use
      different policy in aspect of io aware, discard granularity, delay
      interval and so on. But now they just share one common discard policy,
      so there will be race when changing policy in between these scenarios,
      the interference of changing discard policy will be very serious.
      
      This patch changes to split discard policy for different scenarios.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      78997b56
    • C
      f2fs: wrap discard policy · ecc9aa00
      Chao Yu 提交于
      This patch wraps scattered optional parameters into discard policy as
      below, later, with it we expect that we can adjust these parameters with
      proper strategy in different scenario.
      
      struct discard_policy {
      	unsigned int min_interval;	/* used for candidates exist */
      	unsigned int max_interval;	/* used for candidates not exist */
      	unsigned int max_requests;	/* # of discards issued per round */
      	unsigned int io_aware_gran;	/* minimum granularity discard not be aware of I/O */
      	bool io_aware;			/* issue discard in idle time */
      	bool sync;			/* submit discard with REQ_SYNC flag */
      };
      
      This patch doesn't change any logic of codes.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ecc9aa00
    • C
      f2fs: support issuing/waiting discard in range · 8412663d
      Chao Yu 提交于
      Fstrim intends to trim invalid blocks of filesystem only with specified
      range and granularity, but actually, it will issue all previous cached
      discard commands which may be out-of-range and be with unmatched
      granularity, it's unneeded.
      
      In order to fix above issues, this patch introduces new helps to support
      to issue and wait discard in range and adds a new fstrim_list for tracking
      in-flight discard from ->fstrim.
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      8412663d
  12. 11 10月, 2017 1 次提交