1. 17 12月, 2015 1 次提交
  2. 16 12月, 2015 2 次提交
  3. 15 12月, 2015 1 次提交
  4. 10 12月, 2015 1 次提交
  5. 05 12月, 2015 2 次提交
    • C
      f2fs: fix memory leak of kobject in error path of fill_super · 29ba108d
      Chao Yu 提交于
      f2fs_sb_info::s_kobj should be released in error path of fill_super,
      otherwise it will lead to memory leak.
      
      This bug was found by kmemleak:
      
      dmesg:
      kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
      
      cat /sys/kernel/debug/kmemleak
      unreferenced object 0xffff8800838dc358 (size 8):
        comm "mount", pid 4154, jiffies 4297482839 (age 1911.412s)
        hex dump (first 8 bytes):
          7a 72 61 6d 31 00 ff ff                          zram1...
        backtrace:
          [<ffffffff817a3668>] kmemleak_alloc+0x28/0x50
          [<ffffffff811dc99f>] __kmalloc_track_caller+0xef/0x1c0
          [<ffffffff8119d1c5>] kstrdup+0x45/0x80
          [<ffffffff8119d228>] kstrdup_const+0x28/0x30
          [<ffffffff813d2333>] kvasprintf_const+0x63/0xa0
          [<ffffffff813c59fc>] kobject_set_name_vargs+0x3c/0xa0
          [<ffffffff813c5a85>] kobject_add_varg+0x25/0x60
          [<ffffffff813c5b13>] kobject_init_and_add+0x53/0x70
          [<ffffffffa07ced19>] f2fs_fill_super+0x9d9/0xc40 [f2fs]
          [<ffffffff811ff0b2>] mount_bdev+0x192/0x1d0
          [<ffffffffa07cd3e5>] f2fs_mount+0x15/0x20 [f2fs]
          [<ffffffff811fec93>] mount_fs+0x43/0x170
          [<ffffffff81220256>] vfs_kern_mount+0x76/0x160
          [<ffffffff812211c8>] do_mount+0x258/0xdc0
          [<ffffffff81221dab>] SyS_mount+0x7b/0xc0
          [<ffffffff817aecd7>] entry_SYSCALL_64_fastpath+0x12/0x6f
      ...
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      29ba108d
    • C
      f2fs: report error of f2fs_create_root_stats · 787c7b8c
      Chao Yu 提交于
      f2fs_create_root_stats can fail due to no memory, report it to user.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      787c7b8c
  6. 13 10月, 2015 1 次提交
    • C
      f2fs: export ra_nid_pages to sysfs · ea1a29a0
      Chao Yu 提交于
      After finishing building free nid cache, we will try to readahead
      asynchronously 4 more pages for the next reloading, the count of
      readahead nid pages is fixed.
      
      In some case, like SMR drive, read less sectors with fixed count
      each time we trigger RA may be low efficient, since we will face
      high seeking overhead, so we'd better let user to configure this
      parameter from sysfs in specific workload.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ea1a29a0
  7. 10 10月, 2015 3 次提交
  8. 02 9月, 2015 1 次提交
  9. 20 8月, 2015 1 次提交
  10. 15 8月, 2015 1 次提交
    • C
      f2fs: handle error of f2fs_iget correctly · 8c14bfad
      Chao Yu 提交于
      In recover_orphan_inode, whenever f2fs_iget fail, we will make kernel panic,
      but it's not reasonable, because f2fs_iget can fail due to a lot of reasons
      including out of memory.
      
      So we change error handling method as below:
      a) when finding no entry for the orphan inode, bug_on for catching bugs;
      b) for other reasons, report it to caller.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      8c14bfad
  11. 12 8月, 2015 1 次提交
    • C
      f2fs: remove inmem radix tree · decd36b6
      Chao Yu 提交于
      Previously, we use radix tree to index all registered page entries for
      atomic file, but now we only use radix tree to see whether current page
      is indexed or not, since the other user of radix tree is gone in commit
      042b7816 ("f2fs: remove unnecessary call to invalidate inmemory pages").
      
      So in this patch, we try to use one more efficient way:
      Introducing a macro ATOMIC_WRITTEN_PAGE, and setting it as page private
      value to indicate page indexing status. By using this way, we can save
      memory and lookup time.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      decd36b6
  12. 05 8月, 2015 5 次提交
  13. 09 6月, 2015 2 次提交
  14. 02 6月, 2015 5 次提交
  15. 29 5月, 2015 4 次提交
  16. 05 5月, 2015 1 次提交
  17. 16 4月, 2015 1 次提交
  18. 11 4月, 2015 4 次提交
  19. 04 3月, 2015 3 次提交
    • C
      f2fs: enable rb-tree extent cache · 1dcc336b
      Chao Yu 提交于
      This patch enables rb-tree based extent cache in f2fs.
      
      When we mount with "-o extent_cache", f2fs will try to add recently accessed
      page-block mappings into rb-tree based extent cache as much as possible, instead
      of original one extent info cache.
      
      By this way, f2fs can support more effective cache between dnode page cache and
      disk. It will supply high hit ratio in the cache with fewer memory when dnode
      page cache are reclaimed in environment of low memory.
      
      Storage: Sandisk sd card 64g
      1.append write file (offset: 0, size: 128M);
      2.override write file (offset: 2M, size: 1M);
      3.override write file (offset: 4M, size: 1M);
      ...
      4.override write file (offset: 48M, size: 1M);
      ...
      5.override write file (offset: 112M, size: 1M);
      6.sync
      7.echo 3 > /proc/sys/vm/drop_caches
      8.read file (size:128M, unit: 4k, count: 32768)
      (time dd if=/mnt/f2fs/128m bs=4k count=32768)
      
      Extent Hit Ratio:
      		before		patched
      Hit Ratio	121 / 1071	1071 / 1071
      
      Performance:
      		before		patched
      real    	0m37.051s	0m35.556s
      user    	0m0.040s	0m0.026s
      sys     	0m2.990s	0m2.251s
      
      Memory Cost:
      		before		patched
      Tree Count:	0		1 (size: 24 bytes)
      Node Count:	0		45 (size: 1440 bytes)
      
      v3:
       o retest and given more details of test result.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      1dcc336b
    • C
      f2fs: add a mount option for rb-tree extent cache · 89672159
      Chao Yu 提交于
      This patch adds a mount option 'extent_cache' in f2fs.
      
      It is try to use a rb-tree based extent cache to cache more mapping information
      with less memory if this option is set, otherwise we will use the original one
      extent info cache.
      Suggested-by: NChangman Lee <cm224.lee@samsung.com>
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      89672159
    • C
      f2fs: move ext_lock out of struct extent_info · 0c872e2d
      Chao Yu 提交于
      Move ext_lock out of struct extent_info, then in the following patches we can
      use variables with struct extent_info type as a parameter to pass pure data.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0c872e2d