1. 09 Dec, 2015 3 commits
  2. 04 Dec, 2015 17 commits
  3. 14 Nov, 2015 2 commits
  4. 09 Nov, 2015 1 commit
  5. 22 Oct, 2015 5 commits
  6. 21 Oct, 2015 2 commits
  7. 20 Oct, 2015 2 commits
  8. 13 Oct, 2015 2 commits
    • Jaegeuk Kim's avatar
      f2fs: relocate the tracepoint for background_gc · 84e4214f
      Jaegeuk Kim authored
      
      
      Once f2fs_gc is done, wait_ms is changed once more.
      So, its tracepoint would be located after it.
      Reported-by: default avatarHe YunLei <heyunlei@huawei.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      84e4214f
    • Chao Yu's avatar
      f2fs crypto: fix racing of accessing encrypted page among · 08b39fbd
      Chao Yu authored
      
      
       different competitors
      
      Since we use different page cache (normally inode's page cache for R/W
      and meta inode's page cache for GC) to cache the same physical block
      which is belong to an encrypted inode. Writeback of these two page
      cache should be exclusive, but now we didn't handle writeback state
      well, so there may be potential racing problem:
      
      a)
      kworker:				f2fs_gc:
       - f2fs_write_data_pages
        - f2fs_write_data_page
         - do_write_data_page
          - write_data_page
           - f2fs_submit_page_mbio
      (page#1 in inode's page cache was queued
      in f2fs bio cache, and be ready to write
      to new blkaddr)
      					 - gc_data_segment
      					  - move_encrypted_block
      					   - pagecache_get_page
      					(page#2 in meta inode's page cache
      					was cached with the invalid datas
      					of physical block located in new
      					blkaddr)
      					   - f2fs_submit_page_mbio
      					(page#1 was submitted, later, page#2
      					with invalid data will be submitted)
      
      b)
      f2fs_gc:
       - gc_data_segment
        - move_encrypted_block
         - f2fs_submit_page_mbio
      (page#1 in meta inode's page cache was
      queued in f2fs bio cache, and be ready
      to write to new blkaddr)
      					user thread:
      					 - f2fs_write_begin
      					  - f2fs_submit_page_bio
      					(we submit the request to block layer
      					to update page#2 in inode's page cache
      					with physical block located in new
      					blkaddr, so here we may read gabbage
      					data from new blkaddr since GC hasn't
      					writebacked the page#1 yet)
      
      This patch fixes above potential racing problem for encrypted inode.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      08b39fbd
  9. 12 Oct, 2015 6 commits
    • Chao Yu's avatar
      f2fs: export ra_nid_pages to sysfs · ea1a29a0
      Chao Yu authored
      
      
      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: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      ea1a29a0
    • Chao Yu's avatar
      f2fs: readahead for free nids building · 2db2388f
      Chao Yu authored
      
      
      When there is no free nid in nid cache, all new node allocaters stop their
      job to wait for reloading of free nids, however reloading is synchronous as
      we will read 4 NAT pages for building nid cache, it cause the long latency.
      
      This patch tries to readahead more NAT pages with READA request flag after
      reloading of free nids. It helps to improve performance when users allocate
      node id intensively.
      
      Env: Sandisk 32G sd card
      time for i in `seq 1 60000`; { echo -n > /mnt/f2fs/$i; echo XXXXXX > /mnt/f2fs/$i;}
      
      Before:
      real    0m2.814s
      user    0m1.220s
      sys     0m1.536s
      
      After:
      real    0m2.711s
      user    0m1.136s
      sys     0m1.568s
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      2db2388f
    • Chao Yu's avatar
      f2fs: support lower priority asynchronous readahead in ra_meta_pages · 26879fb1
      Chao Yu authored
      
      
      Now, we use ra_meta_pages to reads continuous physical blocks as much as
      possible to improve performance of following reads. However, ra_meta_pages
      uses a synchronous readahead approach by submitting bio with READ, as READ
      is with high priority, it can not be used in the case of preloading blocks,
      and it's not sure when these RAed pages will be used.
      
      This patch supports asynchronous readahead in ra_meta_pages by tagging bio
      with READA flag in order to allow preloading.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      26879fb1
    • Chao Yu's avatar
      f2fs: don't tag REQ_META for temporary non-meta pages · 2b947003
      Chao Yu authored
      
      
      In recovery or checkpoint flow, we grab pages temperarily in meta inode's
      mapping for caching temperary data, actually, datas in these pages were
      not meta data of f2fs, but still we tag them with REQ_META flag. However,
      lower device like eMMC may do some optimization for data of such type.
      So in order to avoid wrong optimization, we'd better remove such flag
      for temperary non-meta pages.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      2b947003
    • Chao Yu's avatar
      f2fs: add a tracepoint for f2fs_read_data_pages · b8c29400
      Chao Yu authored
      
      
      This patch adds a tracepoint for f2fs_read_data_pages to trace when pages
      are readahead by VFS.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      b8c29400
    • Jaegeuk Kim's avatar
      f2fs: set GFP_NOFS for grab_cache_page · a56c7c6f
      Jaegeuk Kim authored
      
      
      For normal inodes, their pages are allocated with __GFP_FS, which can cause
      filesystem calls when reclaiming memory.
      This can incur a dead lock condition accordingly.
      
      So, this patch addresses this problem by introducing
      f2fs_grab_cache_page(.., bool for_write), which calls
      grab_cache_page_write_begin() with AOP_FLAG_NOFS.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      a56c7c6f