1. 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
  2. 12 3月, 2014 1 次提交
  3. 10 3月, 2014 2 次提交
  4. 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
  5. 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
  6. 20 1月, 2014 1 次提交
  7. 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
  8. 23 12月, 2013 12 次提交
  9. 08 11月, 2013 2 次提交
  10. 25 10月, 2013 2 次提交
  11. 18 10月, 2013 2 次提交
  12. 08 10月, 2013 1 次提交
  13. 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
  14. 26 8月, 2013 3 次提交
  15. 20 8月, 2013 1 次提交
  16. 12 8月, 2013 1 次提交
  17. 08 8月, 2013 1 次提交
    • J
      f2fs: fix a build failure due to missing the kobject header · c2d715d1
      Jaegeuk Kim 提交于
      This patch should resolve the following error reported by kbuild test robot.
      
      All error/warnings:
      
         In file included from fs/f2fs/dir.c:13:0:
         >> fs/f2fs/f2fs.h:435:17: error: field 's_kobj' has incomplete type
              struct kobject s_kobj;
      
      The failure was caused by missing the kobject header file in dir.c.
      So, this patch move the header file to the right location, f2fs.h.
      
      CC: Namjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      c2d715d1
  18. 06 8月, 2013 2 次提交
  19. 30 7月, 2013 1 次提交
  20. 17 6月, 2013 1 次提交
    • N
      f2fs: add remount_fs callback support · 696c018c
      Namjae Jeon 提交于
      Add the f2fs_remount function call which will be used
      during the filesystem remounting. This function
      will help us to change the mount options specific to
      f2fs.
      
      Also modify the f2fs background_gc mount option, which
      will allow the user to dynamically trun on/off the
      garbage collection in f2fs based on the background_gc
      value. If background_gc=on, Garbage collection will
      be turned off & if background_gc=off, Garbage collection
      will be truned on.
      
      By default the garbage collection is on in f2fs.
      
      Change Log:
      v2: Incorporated the review comments by Gu Zheng.
          Removing the restore part for VFS flags
          Updating comments with proper flag conditions
          Display GC background option as ON/OFF
          Revised conditions to stop GC in case of remount
      
      v1: Initial changes for adding remount_fs callback
      support.
      
      Cc: Gu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NPankaj Kumar <pankaj.km@samsung.com>
      Reviewed-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      [Jaegeuk Kim: change /** with /* for the coding style]
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      696c018c