1. 07 5月, 2014 2 次提交
  2. 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
  3. 01 4月, 2014 1 次提交
  4. 20 3月, 2014 2 次提交
    • 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: 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
  5. 18 3月, 2014 2 次提交
    • C
      f2fs: fix incorrect parsing with option string · 04c09388
      Chao Yu 提交于
      Previously 'background_gc={on***,off***}' is being parsed as correct option,
      with this patch we cloud fix the trivial bug in mount process.
      
      Change log from v1:
       o need to check length of parameter suggested by Jaegeuk Kim.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      04c09388
    • C
      f2fs: print type for each segment in segment_info's show · 90aa6dc9
      Chao Yu 提交于
      The original segment_info's show looks out-of-format:
      cat /proc/fs/f2fs/loop0/segment_info
      0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 0
      0 0 0 0 0 0 0 0 0 512
      512 512 512 512 512 512 512 0 0 512
      348 0 263 0 0 512 0 0 512 512
      512 512 0 512 512 512 512 512 512 512
      512 512 511 328 512 512 512 512 512 512
      512 512 512 512 512 512 512 0 0 175
      
      Let's fix this and show type for each segment.
      cat /proc/fs/f2fs/loop0/segment_info
      format: segment_type|valid_blocks
      segment_type(0:HD, 1:WD, 2:CD, 3:HN, 4:WN, 5:CN)
      0    2|0   1|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0
      10   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0
      20   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0
      30   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0
      40   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0   0|0
      50   3|0   3|0   3|0   3|0   3|0   3|0   3|0   0|0   3|0   3|0
      60   3|0   3|0   3|0   3|0   3|0   3|0   3|0   3|0   3|0   3|512
      70   3|512 3|512 3|512 3|512 3|512 3|512 3|512 3|0   3|0   3|512
      80   3|0   3|0   3|0   3|0   3|0   3|512 3|0   3|0   3|512 3|512
      90   3|512 0|512 3|274 0|512 0|512 0|512 0|512 0|512 0|512 3|512
      100  3|512 0|512 3|511 0|328 3|512 0|512 0|512 3|512 0|512 0|512
      110  0|512 0|512 0|512 0|512 0|512 0|512 0|512 5|0   4|0   3|512
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      90aa6dc9
  6. 13 3月, 2014 1 次提交
    • T
      fs: push sync_filesystem() down to the file system's remount_fs() · 02b9984d
      Theodore Ts'o 提交于
      Previously, the no-op "mount -o mount /dev/xxx" operation when the
      file system is already mounted read-write causes an implied,
      unconditional syncfs().  This seems pretty stupid, and it's certainly
      documented or guaraunteed to do this, nor is it particularly useful,
      except in the case where the file system was mounted rw and is getting
      remounted read-only.
      
      However, it's possible that there might be some file systems that are
      actually depending on this behavior.  In most file systems, it's
      probably fine to only call sync_filesystem() when transitioning from
      read-write to read-only, and there are some file systems where this is
      not needed at all (for example, for a pseudo-filesystem or something
      like romfs).
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: linux-fsdevel@vger.kernel.org
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Artem Bityutskiy <dedekind1@gmail.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Evgeniy Dushistov <dushistov@mail.ru>
      Cc: Jan Kara <jack@suse.cz>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Anders Larsen <al@alarsen.net>
      Cc: Phillip Lougher <phillip@squashfs.org.uk>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
      Cc: Petr Vandrovec <petr@vandrovec.name>
      Cc: xfs@oss.sgi.com
      Cc: linux-btrfs@vger.kernel.org
      Cc: linux-cifs@vger.kernel.org
      Cc: samba-technical@lists.samba.org
      Cc: codalist@coda.cs.cmu.edu
      Cc: linux-ext4@vger.kernel.org
      Cc: linux-f2fs-devel@lists.sourceforge.net
      Cc: fuse-devel@lists.sourceforge.net
      Cc: cluster-devel@redhat.com
      Cc: linux-mtd@lists.infradead.org
      Cc: jfs-discussion@lists.sourceforge.net
      Cc: linux-nfs@vger.kernel.org
      Cc: linux-nilfs@vger.kernel.org
      Cc: linux-ntfs-dev@lists.sourceforge.net
      Cc: ocfs2-devel@oss.oracle.com
      Cc: reiserfs-devel@vger.kernel.org
      02b9984d
  7. 12 3月, 2014 1 次提交
  8. 10 3月, 2014 2 次提交
  9. 27 2月, 2014 1 次提交
    • 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
  10. 24 2月, 2014 1 次提交
    • J
      f2fs: fix to do build_stat prior to the recovery procedure · 6437d1b0
      Jaegeuk Kim 提交于
      At the end of the recovery procedure, write_checkpoint is called and updates
      the cp count which is managed by f2fs stat.
      But, previously build_stat() is called after the recovery procedure, which
      results in:
      
      BUG: unable to handle kernel NULL pointer dereference at 000000000000012c
      IP: [<ffffffffa03b1030>] write_checkpoint+0x720/0xbc0 [f2fs]
      Call Trace:
       [<ffffffff810a6b44>] ? mark_held_locks+0x74/0x140
       [<ffffffff8109a3e0>] ? __init_waitqueue_head+0x60/0x60
       [<ffffffffa03bf036>] recover_fsync_data+0x656/0xf20 [f2fs]
       [<ffffffff812ee3eb>] ? security_d_instantiate+0x1b/0x30
       [<ffffffffa03aeb4d>] f2fs_fill_super+0x94d/0xa00 [f2fs]
       [<ffffffff811a9825>] mount_bdev+0x1a5/0x1f0
       [<ffffffff8114915e>] ? __get_free_pages+0xe/0x40
       [<ffffffffa03ae200>] ? f2fs_remount+0x130/0x130 [f2fs]
       [<ffffffffa03aa575>] f2fs_mount+0x15/0x20 [f2fs]
       [<ffffffff811aa713>] mount_fs+0x43/0x1b0
       [<ffffffff811c7124>] vfs_kern_mount+0x74/0x160
       [<ffffffff811c5cb1>] ? __get_fs_type+0x51/0x60
       [<ffffffff811c9727>] do_mount+0x237/0xb50
       [<ffffffff811c936a>] ? copy_mount_options+0x3a/0x170
      
      So, this patche changes the order of recovery_fsync_data() and
      f2fs_build_stats().
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      6437d1b0
  11. 20 1月, 2014 1 次提交
  12. 08 1月, 2014 1 次提交
    • J
      f2fs: add a sysfs entry to control max_victim_search · b1c57c1c
      Jaegeuk Kim 提交于
      Previously during SSR and GC, the maximum number of retrials to find a victim
      segment was hard-coded by MAX_VICTIM_SEARCH, 4096 by default.
      
      This number makes an effect on IO locality, when SSR mode is activated, which
      results in performance fluctuation on some low-end devices.
      
      If max_victim_search = 4, the victim will be searched like below.
      ("D" represents a dirty segment, and "*" indicates a selected victim segment.)
      
       D1 D2 D3 D4 D5 D6 D7 D8 D9
      [   *       ]
            [   *    ]
                  [         * ]
      	                [ ....]
      
      This patch adds a sysfs entry to control the number dynamically through:
        /sys/fs/f2fs/$dev/max_victim_search
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      b1c57c1c
  13. 23 12月, 2013 12 次提交
  14. 08 11月, 2013 2 次提交
  15. 25 10月, 2013 2 次提交
  16. 18 10月, 2013 2 次提交
  17. 08 10月, 2013 1 次提交
  18. 07 10月, 2013 2 次提交
    • K
      f2fs: handle remount options correctly · 4058c511
      Kelly Anderson 提交于
      The current f2fs code errors if the xattr or acl options are passed when
      remounting.  This is important in a typical scenario where f2fs is mounted
      as a "ro" root file-system by the boot loader and then the init process wants
      to remount it "rw" with the "remount,rw" option.
      Signed-off-by: NKelly Anderson <kelly@xilka.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      4058c511
    • G
      f2fs: use rw_sem instead of fs_lock(locks mutex) · e479556b
      Gu Zheng 提交于
      The fs_locks is used to block other ops(ex, recovery) when doing checkpoint.
      And each other operate routine(besides checkpoint) needs to acquire a fs_lock,
      there is a terrible problem here, if these are too many concurrency threads acquiring
      fs_lock, so that they will block each other and may lead to some performance problem,
      but this is not the phenomenon we want to see.
      Though there are some optimization patches introduced to enhance the usage of fs_lock,
      but the thorough solution is using a *rw_sem* to replace the fs_lock.
      Checkpoint routine takes write_sem, and other ops take read_sem, so that we can block
      other ops(ex, recovery) when doing checkpoint, and other ops will not disturb each other,
      this can avoid the problem described above completely.
      Because of the weakness of rw_sem, the above change may introduce a potential problem
      that the checkpoint thread might get starved if other threads are intensively locking
      the read semaphore for I/O.(Pointed out by Xu Jin)
      In order to avoid this, a wait_list is introduced, the appending read semaphore ops
      will be dropped into the wait_list if checkpoint thread is waiting for write semaphore,
      and will be waked up when checkpoint thread gives up write semaphore.
      Thanks to Kim's previous review and test, and will be very glad to see other guys'
      performance tests about this patch.
      
      V2:
        -fix the potential starvation problem.
        -use more suitable func name suggested by Xu Jin.
      Signed-off-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      [Jaegeuk Kim: adjust minor coding standard]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      e479556b
  19. 26 8月, 2013 3 次提交