1. 30 Dec, 2015 1 commit
  2. 22 Dec, 2015 1 commit
  3. 14 Dec, 2015 1 commit
  4. 12 Oct, 2015 5 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>
    • 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;}
      real    0m2.814s
      user    0m1.220s
      sys     0m1.536s
      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>
    • 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>
    • 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>
    • Jaegeuk Kim's avatar
      Revert "f2fs: do not skip dentry block writes" · a1257023
      Jaegeuk Kim authored
      The periodic checkpoint can resolve the previous issue.
      So, now we can use this again to improve the reported performance regression:
      This reverts commit 15bec0ff5a9ba6d203178fa8772259df6207942a.
  5. 09 Oct, 2015 2 commits
  6. 24 Aug, 2015 3 commits
    • Chao Yu's avatar
      f2fs: fix to release inode correctly · 13ec7297
      Chao Yu authored
      In following call stack, if unfortunately we lose all chances to truncate
      inode page in remove_inode_page, eventually we will add the nid allocated
      previously into free nid cache, this nid is with NID_NEW status and with
      NEW_ADDR in its blkaddr pointer:
       - f2fs_create
        - f2fs_add_link
         - __f2fs_add_link
          - init_inode_metadata
           - new_inode_page
            - new_node_page
             - set_node_addr(, NEW_ADDR)
           - f2fs_init_acl   failed
           - remove_inode_page  failed
        - handle_failed_inode
         - remove_inode_page  failed
         - iput
          - f2fs_evict_inode
           - remove_inode_page  failed
           - alloc_nid_failed   cache a nid with valid blkaddr: NEW_ADDR
      This may not only cause resource leak of previous inode, but also may cause
      incorrect use of the previous blkaddr which is located in NO.nid node entry
      when this nid is reused by others.
      This patch tries to add this inode to orphan list if we fail to truncate
      inode, so that we can obtain a second chance to release it in orphan
      recovery flow.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    • Jaegeuk Kim's avatar
      f2fs: fix wrong pointer access during try_to_free_nids · f7409d0f
      Jaegeuk Kim authored
      If we release the lock in list_for_each_entry_safe, we can lose the tmp
      pointer by alloc_nid.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    • Jaegeuk Kim's avatar
      f2fs: use __GFP_NOFAIL to avoid infinite loop · 80c54505
      Jaegeuk Kim authored
      __GFP_NOFAIL can avoid retrying the whole path of kmem_cache_alloc and
      And, it also fixes the use cases of GFP_ATOMIC correctly.
      Suggested-by: default avatarChao Yu <chao2.yu@samsung.com>
      Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
  7. 20 Aug, 2015 3 commits
  8. 05 Aug, 2015 2 commits
  9. 04 Aug, 2015 1 commit
  10. 02 Jun, 2015 1 commit
    • Tejun Heo's avatar
      writeback: move bandwidth related fields from backing_dev_info into bdi_writeback · a88a341a
      Tejun Heo authored
      Currently, a bdi (backing_dev_info) embeds single wb (bdi_writeback)
      and the role of the separation is unclear.  For cgroup support for
      writeback IOs, a bdi will be updated to host multiple wb's where each
      wb serves writeback IOs of a different cgroup on the bdi.  To achieve
      that, a wb should carry all states necessary for servicing writeback
      IOs for a cgroup independently.
      This patch moves bandwidth related fields from backing_dev_info into
      * The moved fields are: bw_time_stamp, dirtied_stamp, written_stamp,
        write_bandwidth, avg_write_bandwidth, dirty_ratelimit,
        balanced_dirty_ratelimit, completions and dirty_exceeded.
      * writeback_chunk_size() and over_bground_thresh() now take @wb
        instead of @bdi.
      * bdi_writeout_fraction(bdi, ...)	-> wb_writeout_fraction(wb, ...)
        bdi_dirty_limit(bdi, ...)		-> wb_dirty_limit(wb, ...)
        bdi_position_ration(bdi, ...)		-> wb_position_ratio(wb, ...)
        bdi_update_writebandwidth(bdi, ...)	-> wb_update_write_bandwidth(wb, ...)
        [__]bdi_update_bandwidth(bdi, ...)	-> [__]wb_update_bandwidth(wb, ...)
        bdi_{max|min}_pause(bdi, ...)		-> wb_{max|min}_pause(wb, ...)
        bdi_dirty_limits(bdi, ...)		-> wb_dirty_limits(wb, ...)
      * Init/exits of the relocated fields are moved to bdi_wb_init/exit()
        respectively.  Note that explicit zeroing is dropped in the process
        as wb's are cleared in entirety anyway.
      * As there's still only one bdi_writeback per backing_dev_info, all
        uses of bdi->stat[] are mechanically replaced with bdi->wb.stat[]
        introducing no behavior changes.
      v2: Typo in description fixed as suggested by Jan.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Cc: Jaegeuk Kim <jaegeuk@kernel.org>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
  11. 28 May, 2015 4 commits
  12. 07 May, 2015 1 commit
  13. 10 Apr, 2015 3 commits
  14. 03 Mar, 2015 1 commit
    • Chao Yu's avatar
      f2fs: add core functions for rb-tree extent cache · 429511cd
      Chao Yu authored
      This patch adds core functions including slab cache init function and
      init/lookup/update/shrink/destroy function for rb-tree based extent cache.
      Thank Jaegeuk Kim and Changman Lee as they gave much suggestion about detail
      design and implementation of extent cache.
       * register rb-based extent cache shrink with mm shrink interface.
       o move set_extent_info and __is_{extent,back,front}_mergeable into f2fs.h.
       o introduce __{attach,detach}_extent_node for code readability.
       o add cond_resched() when fail to invoke kmem_cache_alloc/radix_tree_insert.
       o fix some coding style and typo issues.
       o fix oops due to using an unassigned pointer.
       o use list_del to remove extent node in shrink list.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarChangman Lee <cm224.lee@samsung.com>
      [Jaegeuk Kim: add static for some funcitons and declare in f2fs.h]
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
  15. 12 Feb, 2015 5 commits
    • Jaegeuk Kim's avatar
      f2fs: fix accessing wrong indexed data blocks · f1a3b98e
      Jaegeuk Kim authored
      This patch fixes the following test.
      This causes:
       attempt to access beyond end of device
       sdb2: rw=16384, want=14413962000, limit=16777216
      The reason is:
       - f2fs_write_begin
        - f2fs_convert_inline_inode returns -ENOSPC
        - f2fs_write_failed
         - truncate_blocks
          - truncate_partial_data_page
           - find_data_page
            - get_dnode_of_data returns wrong data index retrieved from inline_data
            - f2fs_submit_page_bio(wrong data index)
             - submit_bio(wrong data index)
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    • Jaegeuk Kim's avatar
      f2fs: check node page contents all the time · aaf96075
      Jaegeuk Kim authored
      In get_node_page, if the page is up-to-date, we assumed that the page was not
      reclaimed at all.
      But, sometimes it was reported that its contents was missing.
      So, just for sure, let's check its mapping and contents.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    • Chao Yu's avatar
      f2fs: merge {invalidate,release}page for meta/node/data pages · 487261f3
      Chao Yu authored
      This patch merges ->{invalidate,release}page function for meta/node/data pages.
      After this, duplication of codes could be removed.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    • Jaegeuk Kim's avatar
      f2fs: keep PagePrivate during releasepage · f68daeeb
      Jaegeuk Kim authored
      If PagePrivate is removed by releasepage, f2fs loses counting dirty pages.
      e.g., try_to_release_page will not release page when the page is dirty,
      but our releasepage removes PagePrivate.
          [<ffffffff81188d75>] try_to_release_page+0x35/0x50
          [<ffffffff811996f9>] invalidate_inode_pages2_range+0x2f9/0x3b0
          [<ffffffffa02a7f54>] ? truncate_blocks+0x384/0x4d0 [f2fs]
          [<ffffffffa02b7583>] ? f2fs_direct_IO+0x283/0x290 [f2fs]
          [<ffffffffa02b7fb0>] ? get_data_block_fiemap+0x20/0x20 [f2fs]
          [<ffffffff8118aa53>] generic_file_direct_write+0x163/0x170
          [<ffffffff8118ad06>] __generic_file_write_iter+0x2a6/0x350
          [<ffffffff8118adef>] generic_file_write_iter+0x3f/0xb0
          [<ffffffff81203081>] new_sync_write+0x81/0xb0
          [<ffffffff81203837>] vfs_write+0xb7/0x1f0
          [<ffffffff81204459>] SyS_write+0x49/0xb0
          [<ffffffff817c286d>] system_call_fastpath+0x16/0x1b
      Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    • Chao Yu's avatar
      f2fs: merge flags in struct f2fs_sb_info · caf0047e
      Chao Yu authored
      Currently, there are several variables with Boolean type as below:
      struct f2fs_sb_info {
      	int s_dirty;
      	bool need_fsck;
      	bool s_closing;
      	bool por_doing;
      For this there are some issues:
      1. there are some space of f2fs_sb_info is wasted due to aligning after Boolean
         type variables by compiler.
      2. if we continuously add new flag into f2fs_sb_info, structure will be messed
      So in this patch, we try to:
      1. switch s_dirty to Boolean type variable since it has two status 0/1.
      2. merge s_dirty/need_fsck/s_closing/por_doing variables into s_flag.
      3. introduce an enum type which can indicate different states of sbi.
      4. use new introduced universal interfaces is_sbi_flag_set/{set,clear}_sbi_flag
         to operate flags for sbi.
      After that, above issues will be fixed.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
  16. 10 Jan, 2015 6 commits