1. 14 11月, 2015 2 次提交
  2. 10 11月, 2015 1 次提交
  3. 23 10月, 2015 3 次提交
  4. 22 10月, 2015 3 次提交
  5. 21 10月, 2015 3 次提交
  6. 14 10月, 2015 2 次提交
    • J
      f2fs: relocate the tracepoint for background_gc · 84e4214f
      Jaegeuk Kim 提交于
      Once f2fs_gc is done, wait_ms is changed once more.
      So, its tracepoint would be located after it.
      Reported-by: NHe YunLei <heyunlei@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      84e4214f
    • C
      f2fs crypto: fix racing of accessing encrypted page among · 08b39fbd
      Chao Yu 提交于
       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: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      08b39fbd
  7. 13 10月, 2015 9 次提交
  8. 10 10月, 2015 17 次提交
    • J
      f2fs: merge meta writes as many possible · 6066d8cd
      Jaegeuk Kim 提交于
      This patch tries to merge IOs as many as possible when background flusher
      conducts flushing the dirty meta pages.
      
      [Before]
      
      ...
      2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 124320, size = 4096
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 124560, size = 32768
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 95720, size = 987136
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 123928, size = 4096
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 123944, size = 8192
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 123968, size = 45056
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 124064, size = 4096
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 97648, size = 1007616
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 123776, size = 8192
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 123800, size = 32768
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 124624, size = 4096
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 99616, size = 921600
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 123608, size = 4096
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 123624, size = 77824
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 123792, size = 4096
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 123864, size = 32768
      ...
      
      [After]
      
      ...
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 92168, size = 892928
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 93912, size = 753664
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 95384, size = 716800
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 96784, size = 712704
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 104160, size = 364544
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 104872, size = 356352
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 105568, size = 278528
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 106112, size = 319488
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 106736, size = 258048
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 107240, size = 270336
      f2fs_submit_write_bio: dev = (8,18), WRITE_SYNC(MP), META, sector = 107768, size = 180224
      ...
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6066d8cd
    • J
      f2fs: introduce a periodic checkpoint flow · 60b99b48
      Jaegeuk Kim 提交于
      This patch introduces a periodic checkpoint feature.
      Note that, this is not enforcing to conduct checkpoints very strictly in terms
      of trigger timing, instead just hope to help user experiences.
      The default value is 60 seconds.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      60b99b48
    • J
      f2fs: add a tracepoint for background gc · 5c267434
      Jaegeuk Kim 提交于
      This patch introduces a tracepoint to monitor background gc behaviors.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      5c267434
    • J
      f2fs: introduce background_gc=sync mount option · 6aefd93b
      Jaegeuk Kim 提交于
      This patch introduce background_gc=sync enabling synchronous cleaning in
      background.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6aefd93b
    • C
      f2fs: introduce a new ioctl F2FS_IOC_WRITE_CHECKPOINT · 456b88e4
      Chao Yu 提交于
      This patch introduce a new ioctl for those users who want to trigger
      checkpoint from userspace through ioctl.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      456b88e4
    • C
      f2fs: support synchronous gc in ioctl · d530d4d8
      Chao Yu 提交于
      This patch drops in batches gc triggered through ioctl, since user
      can easily control the gc by designing the loop around the ->ioctl.
      
      We support synchronous gc by forcing using FG_GC in f2fs_gc, so with
      it, user can make sure that in this round all blocks gced were
      persistent in the device until ioctl returned.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d530d4d8
    • C
      f2fs: skip searching dirty map if dirty segment is not exist · 3342bb30
      Chao Yu 提交于
      When searching victim during gc, if there are no dirty segments in
      filesystem, we will still take the time to search the whole dirty segment
      map, it's not needed, it's better to skip in this condition.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      3342bb30
    • C
      f2fs: fix to avoid redundant searching in dirty map during gc · a43f7ec3
      Chao Yu 提交于
      When doing gc, we search a victim in dirty map, starting from position of
      last victim, we will reset the current searching position until we touch
      the end of dirty map, and then search the whole diryt map. So sometimes we
      will search the range [victim, last] twice, it's redundant, this patch
      avoids this issue.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      a43f7ec3
    • C
      f2fs: use atomic64_t for extent cache hit stat · 5b7ee374
      Chao Yu 提交于
      Our hit stat of extent cache will increase all the time until remount,
      and we use atomic_t type for the stat variable, so it may easily incur
      overflow when we query extent cache frequently in a long time running
      fs.
      
      So to avoid that, this patch uses atomic64_t for hit stat variables.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      5b7ee374
    • J
      f2fs: use vmalloc to handle -ENOMEM error · 39307a8e
      Jaegeuk Kim 提交于
      This patch introduces f2fs_kvmalloc to avoid -ENOMEM during mount.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      39307a8e
    • J
      f2fs: should get a victim from retrials · ab126cfc
      Jaegeuk Kim 提交于
      If we do not call get_victim first, we cannot get a new victim for retrial
      path.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      ab126cfc
    • C
      f2fs: fix to correct freed section number during gc · 45fe8492
      Chao Yu 提交于
      This patch fixes to maintain the right section count freed in garbage
      collecting when triggering a foreground gc.
      
      Besides, when a foreground gc is running on current selected section, once
      we fail to gc one segment, it's better to abandon gcing the left segments
      in current section, because anyway we will select next victim for
      foreground gc, so gc on the left segments in previous section will become
      overhead and also cause the long latency for caller.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      45fe8492
    • C
      f2fs: fix to update {m,c}time correctly when truncating larger · 345a6b2e
      Chao Yu 提交于
      This patch fixes to update ctime and atime correctly when truncating
      larger in ->setattr.
      
      The bug is reported by xfstest generic/313 as below:
      
      generic/313 2s ... - output mismatch (see ./results/generic/313.out.bad)
          --- tests/generic/313.out   2015-08-04 15:28:53.430798882 +0800
          +++ results/generic/313.out.bad   2015-09-28 17:04:27.294278016 +0800
          @@ -1,2 +1,4 @@
           QA output created by 313
           Silence is golden
          +ctime not updated after truncate up
          +mtime not updated after truncate up
          ...
          (Run 'diff -u tests/generic/313.out tests/generic/313.out.bad'  to see the entire diff)
      Ran: generic/313
      Failures: generic/313
      Failed 1 of 1 tests
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      345a6b2e
    • J
      f2fs: do not skip dentry block writes · 90b803e6
      Jaegeuk Kim 提交于
      Previously, we skip dentry block writes when wbc is SYNC_NONE with no memory
      pressure and the number of dirty pages is pretty small.
      
      But, we didn't skip for normal data writes, which gives us not much big impact
      on overall performance.
      Moreover, by skipping some data writes, kworker falls into infinite loop to try
      to write blocks, when many dir inodes have only one dentry block.
      
      So, this patch removes skipping data writes.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      90b803e6
    • C
      f2fs: remove unneeded f2fs_{,un}lock_op in do_recover_data() · 72235541
      Chao Yu 提交于
      Protecting recovery flow by using cp_rwsem is not needed, since we have
      prevent triggering any checkpoint by locking cp_mutex previously.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      72235541
    • C
      f2fs: fix incorrect bimodal calculation · 1d7e10d5
      Chao Yu 提交于
      In update_sit_info, we use div_u64 to handle 'u64 divide u64' case, but
      div_u64 can only handle 32-bits divisor, so our divisor with u64 type
      passed to div_u64 will overflow, result in the wrong calculation when
      show debug info of f2fs as below:
      
      BDF: 464, avg. vblocks: 23509
      (BDF should never exceed 100)
      
      So change to use div64_u64 to handle this case correctly.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      1d7e10d5
    • C
      f2fs: introduce __try_update_largest_extent · 4abd3f5a
      Chao Yu 提交于
      This patch adds a new helper __try_update_largest_extent for cleanup.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      4abd3f5a