1. 06 Nov, 2014 1 commit
  2. 05 Nov, 2014 1 commit
  3. 04 Nov, 2014 8 commits
  4. 07 Oct, 2014 1 commit
    • Jaegeuk Kim's avatar
      f2fs: support atomic writes · 88b88a66
      Jaegeuk Kim authored
      This patch introduces a very limited functionality for atomic write support.
      In order to support atomic write, this patch adds two ioctls:
       o F2FS_IOC_START_ATOMIC_WRITE
       o F2FS_IOC_COMMIT_ATOMIC_WRITE
      
      The database engine should be aware of the following sequence.
      1. open
       -> ioctl(F2FS_IOC_START_ATOMIC_WRITE);
      2. writes
        : all the written data will be treated as atomic pages.
      3. commit
       -> ioctl(F2FS_IOC_COMMIT_ATOMIC_WRITE);
        : this flushes all the data blocks to the disk, which will be shown all or
        nothing by f2fs recovery procedure.
      4. repeat to #2
      
      .
      
      The IO pattens should be:
      
        ,- START_ATOMIC_WRITE                  ,- COMMIT_ATOMIC_WRITE
       CP | D D D D D D | FSYNC | D D D D | FSYNC ...
                            `- COMMIT_ATOMIC_WRITE
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      88b88a66
  5. 30 Sep, 2014 2 commits
    • Jaegeuk Kim's avatar
      f2fs: check the use of macros on block counts and addresses · 7cd8558b
      Jaegeuk Kim authored
      
      
      This patch cleans up the existing and new macros for readability.
      
      Rule is like this.
      
               ,-----------------------------------------> MAX_BLKADDR -,
               |  ,------------- TOTAL_BLKS ----------------------------,
               |  |                                                     |
               |  ,- seg0_blkaddr   ,----- sit/nat/ssa/main blkaddress  |
      block    |  | (SEG0_BLKADDR)  | | | |   (e.g., MAIN_BLKADDR)      |
      address  0..x................ a b c d .............................
                  |                                                     |
      global seg# 0...................... m .............................
                  |                       |                             |
                  |                       `------- MAIN_SEGS -----------'
                  `-------------- TOTAL_SEGS ---------------------------'
                                          |                             |
       seg#                               0..........xx..................
      
      = Note =
       o GET_SEGNO_FROM_SEG0 : blk address -> global segno
       o GET_SEGNO           : blk address -> segno
       o START_BLOCK         : segno -> starting block address
      Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      7cd8558b
    • Jaegeuk Kim's avatar
      f2fs: introduce FITRIM in f2fs_ioctl · 4b2fecc8
      Jaegeuk Kim authored
      
      
      This patch introduces FITRIM in f2fs_ioctl.
      In this case, f2fs will issue small discards and prefree discards as many as
      possible for the given area.
      Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      4b2fecc8
  6. 23 Sep, 2014 3 commits
  7. 16 Sep, 2014 1 commit
    • Jaegeuk Kim's avatar
      f2fs: give an option to enable in-place-updates during fsync to users · c1ce1b02
      Jaegeuk Kim authored
      
      
      If user wrote F2FS_IPU_FSYNC:4 in /sys/fs/f2fs/ipu_policy, f2fs_sync_file
      only starts to try in-place-updates.
      And, if the number of dirty pages is over /sys/fs/f2fs/min_fsync_blocks, it
      keeps out-of-order manner. Otherwise, it triggers in-place-updates.
      
      This may be used by storage showing very high random write performance.
      
      For example, it can be used when,
      
      Seq. writes (Data) + wait + Seq. writes (Node)
      
      is pretty much slower than,
      
      Rand. writes (Data)
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      c1ce1b02
  8. 09 Sep, 2014 6 commits
    • Gu Zheng's avatar
      f2fs: use lock-less list(llist) to simplify the flush cmd management · 721bd4d5
      Gu Zheng authored
      
      
      We use flush cmd control to collect many flush cmds, and flush them
      together. In this case, we use two list to manage the flush cmds
      (collect and dispatch), and one spin lock is used to protect this.
      In fact, the lock-less list(llist) is very suitable to this case,
      and we use simplify this routine.
      
      -
      v2:
      -use llist_for_each_entry_safe to fix possible use-after-free issue.
      -remove the unused field from struct flush_cmd.
      Thanks for Yu's suggestion.
      -
      Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      721bd4d5
    • Chao Yu's avatar
      f2fs: refactor flush_sit_entries codes for reducing SIT writes · 184a5cd2
      Chao Yu authored
      In commit aec71382
      
       ("f2fs: refactor flush_nat_entries codes for reducing NAT
      writes"), we descripte the issue as below:
      
      "Although building NAT journal in cursum reduce the read/write work for NAT
      block, but previous design leave us lower performance when write checkpoint
      frequently for these cases:
      1. if journal in cursum has already full, it's a bit of waste that we flush all
         nat entries to page for persistence, but not to cache any entries.
      2. if journal in cursum is not full, we fill nat entries to journal util
         journal is full, then flush the left dirty entries to disk without merge
         journaled entries, so these journaled entries may be flushed to disk at next
         checkpoint but lost chance to flushed last time."
      
      Actually, we have the same problem in using SIT journal area.
      
      In this patch, firstly we will update sit journal with dirty entries as many as
      possible. Secondly if there is no space in sit journal, we will remove all
      entries in journal and walk through the whole dirty entry bitmap of sit,
      accounting dirty sit entries located in same SIT block to sit entry set. All
      entry sets are linked to list sit_entry_set in sm_info, sorted ascending order
      by count of entries in set. Later we flush entries in set which have fewest
      entries into journal as many as we can, and then flush dense set with merged
      entries to disk.
      
      In this way we can use sit journal area more effectively, also we will reduce
      SIT update, result in gaining in performance and saving lifetime of flash
      device.
      
      In my testing environment, it shows this patch can help to reduce SIT block
      update obviously.
      
      virtual machine + hard disk:
      fsstress -p 20 -n 400 -l 5
      		sit page num	cp count	sit pages/cp
      based		2006.50		1349.75		1.486
      patched		1566.25		1463.25		1.070
      
      Our latency of merging op is small when handling a great number of dirty SIT
      entries in flush_sit_entries:
      latency(ns)	dirty sit count
      36038		2151
      49168		2123
      37174		2232
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      184a5cd2
    • Chao Yu's avatar
      f2fs: remove unneeded sit_i in macro SIT_BLOCK_OFFSET/START_SEGNO · d3a14afd
      Chao Yu authored
      
      
      sit_i in macro SIT_BLOCK_OFFSET/START_SEGNO is not used, remove it.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      d3a14afd
    • Jaegeuk Kim's avatar
      f2fs: handle bug cases by letting fsck.f2fs initiate · ec325b52
      Jaegeuk Kim authored
      
      
      This patch adds to handle corner buggy cases for fsck.f2fs.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      ec325b52
    • Jaegeuk Kim's avatar
      f2fs: add BUG cases to initiate fsck.f2fs · 05796763
      Jaegeuk Kim authored
      
      
      This patch replaces BUG cases with f2fs_bug_on to remain fsck.f2fs information.
      And it implements some void functions to initiate fsck.f2fs too.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      05796763
    • Jaegeuk Kim's avatar
      f2fs: need fsck.f2fs when f2fs_bug_on is triggered · 9850cf4a
      Jaegeuk Kim authored
      
      
      If any f2fs_bug_on is triggered, fsck.f2fs is needed.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      9850cf4a
  9. 04 Sep, 2014 1 commit
  10. 21 Aug, 2014 1 commit
    • Jaegeuk Kim's avatar
      f2fs: remove rewrite_node_page · 202095a7
      Jaegeuk Kim authored
      
      
      I think we need to let the dirty node pages remain in the page cache instead
      of rewriting them in their places.
      So, after done with successful recovery, write_checkpoint will flush all of them
      through the normal write path.
      Through this, we can avoid potential error cases in terms of block allocation.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      202095a7
  11. 19 Aug, 2014 1 commit
  12. 04 Aug, 2014 1 commit
  13. 30 Jul, 2014 3 commits
    • Dongho Sim's avatar
      f2fs: remove redundant lines in allocate_data_block · 33be828a
      Dongho Sim authored
      
      
      There are redundant lines in allocate_data_block.
      
      In this function, we call refresh_sit_entry with old seg and old curseg.
      After that, we call locate_dirty_segment with old curseg.
      
      But, the new address is always allocated from old curseg and
      we call locate_dirty_segment with old curseg in refresh_sit_entry.
      So, we do not need to call locate_dirty_segment with old curseg again.
      
      We've discussed like below:
      
      Jaegeuk said:
       "When considering SSR, we need to take care of the following scenario.
        - old segno : X
        - new address : Z
        - old curseg : Y
        This means, a new block is supposed to be written to Z from X.
        And Z is newly allocated in the same path from Y.
      
        In that case, we should trigger locate_dirty_segment for Y, since
        it was a current_segment and can be dirty owing to SSR.
        But that was not included in the dirty list."
      
      Changman said:
       "We already choosed old curseg(Y) and then we allocate new address(Z) from old
        curseg(Y). After that we call refresh_sit_entry(old address, new address).
        In the funcation, we call locate_dirty_segment with old seg and old curseg.
        So calling locate_dirty_segment after refresh_sit_entry again is redundant."
      
      Jaegeuk said:
       "Right. The new address is always allocated from old_curseg."
      Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarDongho Sim <dh.sim@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      33be828a
    • Jaegeuk Kim's avatar
      f2fs: add tracepoint for f2fs_issue_flush · 24a9ee0f
      Jaegeuk Kim authored
      
      
      This patch adds a tracepoint for f2fs_issue_flush.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      24a9ee0f
    • Jaegeuk Kim's avatar
      f2fs: avoid retrying wrong recovery routine when error was occurred · cf2271e7
      Jaegeuk Kim authored
      
      
      This patch eliminates the propagation of recovery errors to the next mount.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      cf2271e7
  14. 29 Jul, 2014 1 commit
  15. 09 Jul, 2014 4 commits
  16. 08 May, 2014 1 commit
  17. 07 May, 2014 4 commits