1. 07 4月, 2014 1 次提交
    • J
      f2fs: introduce f2fs_issue_flush to avoid redundant flush issue · 6b4afdd7
      Jaegeuk Kim 提交于
      Some storage devices show relatively high latencies to complete cache_flush
      commands, even though their normal IO speed is prettry much high. In such
      the case, it needs to merge cache_flush commands as much as possible to avoid
      issuing them redundantly.
      So, this patch introduces a mount option, "-o flush_merge", to mitigate such
      the overhead.
      
      If this option is enabled by user, F2FS merges the cache_flush commands and then
      issues just one cache_flush on behalf of them. Once the single command is
      finished, F2FS sends a completion signal to all the pending threads.
      
      Note that, this option can be used under a workload consisting of very intensive
      concurrent fsync calls, while the storage handles cache_flush commands slowly.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      6b4afdd7
  2. 02 4月, 2014 4 次提交
  3. 01 4月, 2014 3 次提交
  4. 20 3月, 2014 8 次提交
    • J
      f2fs: avoid RECLAIM_FS-ON-W warning · 808a1d74
      Jaegeuk Kim 提交于
      This patch should resolve the following possible bug.
      
      RECLAIM_FS-ON-W at:
       mark_held_locks+0xb9/0x140
       lockdep_trace_alloc+0x85/0xf0
       __kmalloc+0x53/0x1d0
       read_all_xattrs+0x3d1/0x3f0 [f2fs]
       f2fs_getxattr+0x4f/0x100 [f2fs]
       f2fs_get_acl+0x4c/0x290 [f2fs]
       get_acl+0x4f/0x80
       posix_acl_create+0x72/0x180
       f2fs_init_acl+0x29/0xcc [f2fs]
       __f2fs_add_link+0x259/0x710 [f2fs]
       f2fs_create+0xad/0x1c0 [f2fs]
       vfs_create+0xed/0x150
       do_last+0xd36/0xed0
       path_openat+0xc5/0x680
       do_filp_open+0x43/0xa0
       do_sys_open+0x13c/0x230
       SyS_creat+0x1e/0x20
       system_call_fastpath+0x16/0x1b
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      808a1d74
    • J
      f2fs: skip unnecessary node writes during fsync · 479f40c4
      Jaegeuk Kim 提交于
      If multiple redundant fsync calls are triggered, we don't need to write its
      node pages with fsync mark continuously.
      
      So, this patch adds FI_NEED_FSYNC to track whether the latest node block is
      written with the fsync mark or not.
      If the mark was set, a new fsync doesn't need to write a node block.
      Otherwise, we should do a new node block with the mark for roll-forward
      recovery.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      479f40c4
    • J
      f2fs: introduce fi->i_sem to protect fi's info · d928bfbf
      Jaegeuk Kim 提交于
      This patch introduces fi->i_sem to protect fi's info that includes xattr_ver,
      pino, i_nlink.
      This enables to remove i_mutex during f2fs_sync_file, resulting in performance
      improvement when a number of fsync calls are triggered from many concurrent
      threads.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      d928bfbf
    • J
      f2fs: change reclaim rate in percentage · 58c41035
      Jaegeuk Kim 提交于
      It is more reasonable to determine the reclaiming rate of prefree segments
      according to the volume size, which is set to 5% by default.
      For example, if the volume is 128GB, the prefree segments are reclaimed
      when the number reaches to 6.4GB.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      58c41035
    • J
      f2fs: remove unnecessary threshold · a5f42010
      Jaegeuk Kim 提交于
      The NM_WOUT_THRESHOLD is now obsolete since f2fs starts to control on a basis
      of the memory footprint.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      a5f42010
    • J
      f2fs: throttle the memory footprint with a sysfs entry · cdfc41c1
      Jaegeuk Kim 提交于
      This patch introduces ram_thresh, a sysfs entry, which controls the memory
      footprint used by the free nid list and the nat cache.
      
      Previously, the free nid list was controlled by MAX_FREE_NIDS, while the nat
      cache was managed by NM_WOUT_THRESHOLD.
      However, this approach cannot be applied dynamically according to the system.
      
      So, this patch adds ram_thresh that users can specify the threshold, which is
      in order of 1 / 1024.
      For example, if the total ram size is 4GB and the value is set to 10 by default,
      f2fs tries to control the number of free nids and nat caches not to consume over
      10 * (4GB / 1024) = 10MB.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      cdfc41c1
    • J
      f2fs: avoid to drop nat entries due to the negative nr_shrink · 40bb0058
      Jaegeuk Kim 提交于
      The try_to_free_nats should not receive the negative nr_shrink.
      Otherwise, it can drop all the nat entries by the while loop.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      40bb0058
    • J
      f2fs: call f2fs_wait_on_page_writeback instead of native function · 3cb5ad15
      Jaegeuk Kim 提交于
      If a page is on writeback, f2fs can face with deadlock due to under writepages.
      This is caused by merging IOs inside f2fs, so if it comes to detect, let's throw
      merged IOs, which is implemented by f2fs_wait_on_page_writeback.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      3cb5ad15
  5. 18 3月, 2014 8 次提交
  6. 12 3月, 2014 2 次提交
  7. 11 3月, 2014 1 次提交
  8. 10 3月, 2014 4 次提交
  9. 05 3月, 2014 1 次提交
  10. 03 3月, 2014 1 次提交
  11. 28 2月, 2014 1 次提交
    • C
      f2fs: fix dirty page accounting when redirty · 9cf3c389
      Chao Yu 提交于
      We should de-account dirty counters for page when redirty in ->writepage().
      
      Wu Fengguang described in 'commit 971767ca':
      "writeback: fix dirtied pages accounting on redirty
      De-account the accumulative dirty counters on page redirty.
      
      Page redirties (very common in ext4) will introduce mismatch between
      counters (a) and (b)
      
      a) NR_DIRTIED, BDI_DIRTIED, tsk->nr_dirtied
      b) NR_WRITTEN, BDI_WRITTEN
      
      This will introduce systematic errors in balanced_rate and result in
      dirty page position errors (ie. the dirty pages are no longer balanced
      around the global/bdi setpoints)."
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      9cf3c389
  12. 27 2月, 2014 5 次提交
    • C
      f2fs: use existing macro to clean up some codes · 695fd1ed
      Chao Yu 提交于
      This patch use existing macro F2FS_INODE/NEXT_FREE_BLKADDR to clean up some
      codes.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      695fd1ed
    • C
      f2fs: readahead contiguous SSA blocks for f2fs_gc · 81c1a0f1
      Chao Yu 提交于
      If there are multi segments in one section, we will read those SSA blocks which
      have contiguous address one by one in f2fs_gc. It may lost performance, let's
      read ahead SSA blocks by merge multi read request.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      81c1a0f1
    • J
      f2fs: add an sysfs entry to control the directory level · ab9fa662
      Jaegeuk Kim 提交于
      This patch adds an sysfs entry to control dir_level used by the large directory.
      
      The description of this entry is:
      
       dir_level                    This parameter controls the directory level to
      			      support large directory. If a directory has a
      			      number of files, it can reduce the file lookup
      			      latency by increasing this dir_level value.
      			      Otherwise, it needs to decrease this value to
      			      reduce the space overhead. The default value is 0.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      ab9fa662
    • J
      f2fs: introduce large directory support · 38431545
      Jaegeuk Kim 提交于
      This patch introduces an i_dir_level field to support large directory.
      
      Previously, f2fs maintains multi-level hash tables to find a dentry quickly
      from a bunch of chiild dentries in a directory, and the hash tables consist of
      the following tree structure as below.
      
      In Documentation/filesystems/f2fs.txt,
      
      ----------------------
      A : bucket
      B : block
      N : MAX_DIR_HASH_DEPTH
      ----------------------
      
      level #0   | A(2B)
                 |
      level #1   | A(2B) - A(2B)
                 |
      level #2   | A(2B) - A(2B) - A(2B) - A(2B)
           .     |   .       .       .       .
      level #N/2 | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B)
           .     |   .       .       .       .
      level #N   | A(4B) - A(4B) - A(4B) - A(4B) - A(4B) - ... - A(4B)
      
      But, if we can guess that a directory will handle a number of child files,
      we don't need to traverse the tree from level #0 to #N all the time.
      Since the lower level tables contain relatively small number of dentries,
      the miss ratio of the target dentry is likely to be high.
      
      In order to avoid that, we can configure the hash tables sparsely from level #0
      like this.
      
      level #0   | A(2B) - A(2B) - A(2B) - A(2B)
      
      level #1   | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B)
           .     |   .       .       .       .
      level #N/2 | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B)
           .     |   .       .       .       .
      level #N   | A(4B) - A(4B) - A(4B) - A(4B) - A(4B) - ... - A(4B)
      
      With this structure, we can skip the ineffective tree searches in lower level
      hash tables.
      
      This patch adds just a facility for this by introducing i_dir_level in
      f2fs_inode.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      38431545
    • J
      f2fs: remove costly bit operations for f2fs_find_entry · 5d0c6671
      Jaegeuk Kim 提交于
      It turns out that a bit operation like find_next_bit is not always fast enough
      for f2fs_find_entry.
      Instead, it is pretty much simple and fast to traverse each dentries.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      5d0c6671
  13. 24 2月, 2014 1 次提交