1. 10 Jan, 2015 2 commits
    • Jaegeuk Kim's avatar
      f2fs: activate f2fs_trace_ios · db9f7c1a
      Jaegeuk Kim authored
      
      
      This patch activates f2fs_trace_ios.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      db9f7c1a
    • Jaegeuk Kim's avatar
      f2fs: change atomic and volatile write policies · 1e84371f
      Jaegeuk Kim authored
      
      
      This patch adds two new ioctls to release inmemory pages grabbed by atomic
      writes.
       o f2fs_ioc_abort_volatile_write
        - If transaction was failed, all the grabbed pages and data should be written.
       o f2fs_ioc_release_volatile_write
        - This is to enhance the performance of PERSIST mode in sqlite.
      
      In order to avoid huge memory consumption which causes OOM, this patch changes
      volatile writes to use normal dirty pages, instead blocked flushing to the disk
      as long as system does not suffer from memory pressure.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      1e84371f
  2. 08 Dec, 2014 3 commits
  3. 01 Dec, 2014 1 commit
  4. 11 Nov, 2014 2 commits
    • Jaegeuk Kim's avatar
      f2fs: convert inline_data when i_size becomes large · 92dffd01
      Jaegeuk Kim authored
      
      
      If i_size becomes large outside of MAX_INLINE_DATA, we shoud convert the inode.
      Otherwise, we can make some dirty pages during the truncation, and those pages
      will be written through f2fs_write_data_page.
      At that moment, the inode has still inline_data, so that it tries to write non-
      zero pages into inline_data area.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      92dffd01
    • Jaegeuk Kim's avatar
      f2fs: fix deadlock to grab 0'th data page · 764d2c80
      Jaegeuk Kim authored
      
      
      The scenario is like this.
      
      One trhead triggers:
        f2fs_write_data_pages
          lock_page
          f2fs_write_data_page
            f2fs_lock_op  <- wait
      
      The other thread triggers:
        f2fs_truncate
          truncate_blocks
            f2fs_lock_op
              truncate_partial_data_page
                lock_page  <- wait for locking the page
      
      This patch resolves this bug by relocating truncate_partial_data_page.
      This function is just to truncate user data page and not related to FS
      consistency as well.
      And, we don't need to call truncate_inline_data. Rather than that,
      f2fs_write_data_page will finally update inline_data later.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      764d2c80
  5. 06 Nov, 2014 1 commit
  6. 05 Nov, 2014 2 commits
  7. 04 Nov, 2014 5 commits
  8. 07 Oct, 2014 2 commits
    • Jaegeuk Kim's avatar
      f2fs: support volatile operations for transient data · 02a1335f
      Jaegeuk Kim authored
      
      
      This patch adds support for volatile writes which keep data pages in memory
      until f2fs_evict_inode is called by iput.
      
      For instance, we can use this feature for the sqlite database as follows.
      While supporting atomic writes for main database file, we can keep its journal
      data temporarily in the page cache by the following sequence.
      
      1. open
       -> ioctl(F2FS_IOC_START_VOLATILE_WRITE);
      2. writes
       : keep all the data in the page cache.
      3. flush to the database file with atomic writes
        a. ioctl(F2FS_IOC_START_ATOMIC_WRITE);
        b. writes
        c. ioctl(F2FS_IOC_COMMIT_ATOMIC_WRITE);
      4. close
       -> drop the cached data
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      02a1335f
    • 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
  9. 30 Sep, 2014 2 commits
  10. 23 Sep, 2014 4 commits
    • Chao Yu's avatar
      f2fs: skip punching hole in special condition · 14cecc5c
      Chao Yu authored
      
      
      Now punching hole in directory is not supported in f2fs, so let's limit file
      type in punch_hole().
      
      In addition, in punch_hole if offset is exceed file size, we should skip
      punching hole.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      14cecc5c
    • Chao Yu's avatar
      f2fs: fix to truncate blocks past EOF in ->setattr · 09db6a2e
      Chao Yu authored
      
      
      By using FALLOC_FL_KEEP_SIZE in ->fallocate of f2fs, we can fallocate block past
      EOF without changing i_size of inode. These blocks past EOF will not be
      truncated in ->setattr as we truncate them only when change the file size.
      
      We should give a chance to truncate blocks out of filesize in setattr().
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      09db6a2e
    • Jaegeuk Kim's avatar
      f2fs: do not skip latest inode information · 19c9c466
      Jaegeuk Kim authored
      
      
      In f2fs_sync_file, if there is no written appended writes, it skips
      to write its node blocks.
      But, if there is up-to-date inode page, we should write it to update
      its metadata during the roll-forward recovery.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      19c9c466
    • Jaegeuk Kim's avatar
      f2fs: fix conditions to remain recovery information in f2fs_sync_file · 88bd02c9
      Jaegeuk Kim authored
      This patch revisited whole the recovery information during the f2fs_sync_file.
      
      In this patch, there are three information to make a decision.
      
      a) IS_CHECKPOINTED,	/* is it checkpointed before? */
      b) HAS_FSYNCED_INODE,	/* is the inode fsynced before? */
      c) HAS_LAST_FSYNC,	/* has the latest node fsync mark? */
      
      And, the scenarios for our rule are based on:
      
      [Term] F: fsync_mark, D: dentry_mark
      
      1. inode(x) | CP | inode(x) | dnode(F)
      2. inode(x) | CP | inode(F) | dnode(F)
      3. inode(x) | CP | dnode(F) | inode(x) | inode(F)
      4. inode(x) | CP | dnode(F) | inode(F)
      5. CP | inode(x) | dnode(F) | inode(DF)
      6. CP | inode(DF) | dnode(F)
      7. CP | dnode(F) | inode(DF)
      8. CP | dnode(F) | inode(x) | inode(DF)
      
      For example, #3, the three conditions should be changed as follows.
      
         inode(x) | CP | dnode(F) | inode(x) | inode(F)
      a)    x       o      o          o          o
      b)    x       x      x          x          o
      c)    x       o      o          x          o
      
      If f2fs_sync_file stops   ------^,
       it should write inode(F)    --------------^
      
      So, the need_inode_block_update should return true, since
       c) get_nat_flag(e, HAS_LAST_FSYNC), is false.
      
      For example, #8
      
      ,
            CP | alloc | dnode(F) | inode(x) | inode(DF)
      a)    o      x        x          x          x
      b)    x               x          x          o
      c)    o               o          x          o
      
      If f2fs_sync_file stops   -------^,
       it should write inode(DF)    --------------^
      
      Note that, the roll-forward policy should follow this rule, which means,
      if there are any missing blocks, we doesn't need to recover that inode.
      Signed-off-by: default avatarHuang Ying <ying.huang@intel.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      88bd02c9
  11. 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
  12. 11 Sep, 2014 1 commit
  13. 09 Sep, 2014 2 commits
  14. 04 Sep, 2014 1 commit
  15. 21 Aug, 2014 2 commits
  16. 19 Aug, 2014 2 commits
  17. 04 Aug, 2014 1 commit
  18. 31 Jul, 2014 1 commit
  19. 30 Jul, 2014 2 commits
  20. 09 Jul, 2014 2 commits
  21. 23 Jun, 2014 1 commit
    • Jaegeuk Kim's avatar
      f2fs: fix not to allocate unnecessary blocks during fallocate · 98397ff3
      Jaegeuk Kim authored
      
      
      This patch fixes the fallocate bug like below. (See xfstests/255)
      
      In fallocate(fd, 0, 20480),
      expand_inode_data processes
      	for (index = pg_start; index <= pg_end; index++) {
      		f2fs_reserve_block();
      		...
      	}
      
      So, even though fallocate requests 20480, 5 blocks, f2fs allocates 6 blocks
      including pg_end.
      So, this patch adds one condition to avoid block allocation.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      98397ff3