30 Apr, 2013

1 commit


23 Apr, 2013

1 commit

  • Add tracepoints in f2fs for tracing the syncing
    operations like filesystem sync, file sync enter/exit.
    It will helf to trace the code under debugging scenarios.

    Also add tracepoints for tracing the various inode operations
    like building inode, eviction of inode, link/unlike of
    inodes.

    Signed-off-by: Namjae Jeon
    Signed-off-by: Pankaj Kumar
    Acked-by: Steven Rostedt
    [Jaegeuk: combine and modify the tracepoint structures]
    Signed-off-by: Jaegeuk Kim

    Namjae Jeon
     

22 Apr, 2013

1 commit

  • Fix to return a negative error code from the error handling
    case instead of 0, as returned elsewhere in this function.
    Introduce by commit c0d39e(f2fs: fix return values from validate superblock)

    Signed-off-by: Wei Yongjun
    Acked-by: Namjae Jeon
    Signed-off-by: Jaegeuk Kim

    Wei Yongjun
     

09 Apr, 2013

1 commit

  • In the previous version, f2fs uses global locks according to the usage types,
    such as directory operations, block allocation, block write, and so on.

    Reference the following lock types in f2fs.h.
    enum lock_type {
    RENAME, /* for renaming operations */
    DENTRY_OPS, /* for directory operations */
    DATA_WRITE, /* for data write */
    DATA_NEW, /* for data allocation */
    DATA_TRUNC, /* for data truncate */
    NODE_NEW, /* for node allocation */
    NODE_TRUNC, /* for node truncate */
    NODE_WRITE, /* for node write */
    NR_LOCK_TYPE,
    };

    In that case, we lose the performance under the multi-threading environment,
    since every types of operations must be conducted one at a time.

    In order to address the problem, let's share the locks globally with a mutex
    array regardless of any types.
    So, let users grab a mutex and perform their jobs in parallel as much as
    possbile.

    For this, I propose a new global lock scheme as follows.

    0. Data structure
    - f2fs_sb_info -> mutex_lock[NR_GLOBAL_LOCKS]
    - f2fs_sb_info -> node_write

    1. mutex_lock_op(sbi)
    - try to get an avaiable lock from the array.
    - returns the index of the gottern lock variable.

    2. mutex_unlock_op(sbi, index of the lock)
    - unlock the given index of the lock.

    3. mutex_lock_all(sbi)
    - grab all the locks in the array before the checkpoint.

    4. mutex_unlock_all(sbi)
    - release all the locks in the array after checkpoint.

    5. block_operations()
    - call mutex_lock_all()
    - sync_dirty_dir_inodes()
    - grab node_write
    - sync_node_pages()

    Note that,
    the pairs of mutex_lock_op()/mutex_unlock_op() and
    mutex_lock_all()/mutex_unlock_all() should be used together.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     

03 Apr, 2013

2 commits

  • In order to do GC more reliably, I'd like to lock the vicitm summary page
    until its GC is completed, and also prevent any checkpoint process.

    Reviewed-by: Namjae Jeon
    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • This patch removes a bitmap for victim segments selected by foreground GC, and
    modifies the other bitmap for victim segments selected by background GC.

    1) foreground GC bitmap
    : We don't need to manage this, since we just only one previous victim section
    number instead of the whole victim history.
    The f2fs uses the victim section number in order not to allocate currently
    GC'ed section to current active logs.

    2) background GC bitmap
    : This bitmap is used to avoid selecting victims repeatedly by background GCs.
    In addition, the victims are able to be selected by foreground GCs, since
    there is no need to read victim blocks during foreground GCs.

    By the fact that the foreground GC reclaims segments in a section unit, it'd
    be better to manage this bitmap based on the section granularity.

    Reviewed-by: Namjae Jeon
    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     

27 Mar, 2013

1 commit


20 Mar, 2013

3 commits


18 Mar, 2013

1 commit


12 Feb, 2013

6 commits

  • This patch makes clearer the ambiguous f2fs_gc flow as follows.

    1. Remove intermediate checkpoint condition during f2fs_gc
    (i.e., should_do_checkpoint() and GC_BLOCKED)

    2. Remove unnecessary return values of f2fs_gc because of #1.
    (i.e., GC_NODE, GC_OK, etc)

    3. Simplify write_checkpoint() because of #2.

    4. Clarify the main f2fs_gc flow.
    o monitor how many freed sections during one iteration of do_garbage_collect().
    o do GC more without checkpoints if we can't get enough free sections.
    o do checkpoint once we've got enough free sections through forground GCs.

    5. Adopt thread-logging (Slack-Space-Recycle) scheme more aggressively on data
    log types. See. get_ssr_segement()

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • In f2fs, there are two superblocks. So when the first superblock was
    invalidate, it should try to check another.

    By Jaegeuk Kim:
    o Remove a white space for coding style
    o Clean up for code readability
    o Fix a typo

    Signed-off-by: Jianpeng Ma
    Signed-off-by: Jaegeuk Kim

    majianpeng
     
  • In some system PAGE_CACHE_SIZE isn't 4K. So using F2FS_BLKSIZE to judge.

    By Jaegeuk Kim:
    o f2fs does not support no other 4KB page cache size.

    Signed-off-by: Jianpeng Ma
    Signed-off-by: Jaegeuk Kim

    majianpeng
     
  • This patch supports ioctl FIFREEZE and FITHAW to snapshot filesystem.
    Before calling f2fs_freeze, all writers would be suspended and sync_fs
    would be completed. So no f2fs has to do something.
    Just background gc operation should be skipped due to generate dirty
    nodes and data until unfreeze.

    Signed-off-by: Changman Lee
    Signed-off-by: Jaegeuk Kim

    Changman Lee
     
  • There is a typo in the ->show_options function for disable_ext_identify.
    Fix it to match the spelling from the documentation.

    Signed-off-by: Alejandro Martinez Ruiz
    Signed-off-by: Jaegeuk Kim

    Alejandro Martinez Ruiz
     
  • This patch enhances the checkpoint routine to cope with IO errors.

    Basically f2fs detects IO errors from end_io_write, and the errors are able to
    be occurred during one of data, node, and meta page writes.

    In the previous code, when an IO error is occurred during writes, f2fs sets a
    flag, CP_ERROR_FLAG, in the raw ckeckpoint buffer which will be written to disk.
    Afterwards, write_checkpoint() will check the flag and remount f2fs as a
    read-only (ro) mode.

    However, even once f2fs is remounted as a ro mode, dirty checkpoint pages are
    freely able to be written to disk by flusher or kswapd in background.
    In such a case, after cold reboot, f2fs would restore the checkpoint data having
    CP_ERROR_FLAG, resulting in disabling write_checkpoint and remounting f2fs as
    a ro mode again.

    Therefore, let's prevent any checkpoint page (meta) writes once an IO error is
    occurred, and remount f2fs as a ro mode right away at that moment.

    Reported-by: Oliver Winker
    Signed-off-by: Jaegeuk Kim
    Reviewed-by: Namjae Jeon

    Jaegeuk Kim
     

22 Jan, 2013

1 commit


15 Jan, 2013

1 commit

  • As the "status" debugfs entry will be maintained for entire F2FS filesystem
    irrespective of the number of partitions.
    So, we can move the initialization to the init part of the f2fs and destroy will
    be done from exit part. After making changes, for individual partition mount -
    entry creation code will not be executed.

    Signed-off-by: Jianpeng Ma
    Signed-off-by: Namjae Jeon
    Signed-off-by: Amit Sahrawat
    Signed-off-by: Jaegeuk Kim

    Namjae Jeon
     

14 Jan, 2013

1 commit


11 Jan, 2013

1 commit

  • The f2fs_balance_fs() is to check the number of free sections and decide whether
    it needs to conduct cleaning or not. If there are not enough free sections, the
    cleaning job should be started.

    In order to control an amount of free sections even under high utilization, f2fs
    should call f2fs_balance_fs at all the VFS interfaces that are able to produce
    dirty pages.
    This patch adds the function calls in the missing interfaces as follows.

    1. f2fs_setxattr()
    The f2fs_setxattr() produces dirty node pages so that we should call
    f2fs_balance_fs() either likewise doing in other VFS interfaces such as
    f2fs_lookup(), f2fs_mkdir(), and so on.

    2. f2fs_sync_file()
    We should guarantee serving free sections for syncing metadata during fsync.
    Previously, there is no space check before triggering checkpoint and
    sync_node_pages.
    Therefore, if a bunch of fsync calls are triggered under 100% of FS utilization,
    f2fs is able to be faced with no free sections, resulting in BUG_ON().

    3. f2fs_sync_fs()
    Before calling write_checkpoint(), we should guarantee that there are minimum
    free sections.

    4. f2fs_write_inode()
    f2fs_write_inode() is also able to produce dirty node pages.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     

04 Jan, 2013

1 commit


28 Dec, 2012

2 commits


26 Dec, 2012

2 commits

  • The recovery routine should do all the time regardless of normal umount action.

    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     
  • In f2fs_statfs(), f_files should be the total number of available inodes
    instead of the currently allocated inodes.
    So, this patch should resolve the reported bug below.

    Note that, showing 10% usage is not a bug, since f2fs reveals whole volume size
    as much as possible and shows the space overhead as *used*.
    This policy is fair enough with respect to other file systems.

    (loop0 is backed by 1GiB file)

    $ mkfs.f2fs /dev/loop0

    F2FS-tools: Ver: 1.1.0 (2012-12-11)
    Info: sector size = 512
    Info: total sectors = 2097152 (in 512bytes)
    Info: zone aligned segment0 blkaddr: 512
    Info: format successful

    $ mount /dev/loop0 mnt/

    $ df mnt/
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/loop0 1046528 98312 929784 10%
    /home/zeta/linux-devel/mtd-bench/mnt

    $ df mnt/ -i
    Filesystem Inodes IUsed IFree IUse% Mounted on
    /dev/loop0 1 -465918 465919 - /home/zeta/linux-devel/mtd-bench/mnt

    Notice IUsed is negative. Also, 10% usage on a fresh f2fs seems too
    much to be correct.

    Reported-and-Tested-by: Ezequiel Garcia
    Signed-off-by: Jaegeuk Kim

    Jaegeuk Kim
     

11 Dec, 2012

5 commits