1. 09 Apr, 2013 2 commits
    • Jaegeuk Kim's avatar
      f2fs: introduce a new global lock scheme · 39936837
      Jaegeuk Kim authored
      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: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      39936837
    • Jason Hrycay's avatar
      f2fs: move f2fs_balance_fs from truncate to punch_hole · 1127a3d4
      Jason Hrycay authored
      Move the f2fs_balance_fs out of the truncate_hole function and only
      perform that in punch_hole use case.  The commit:
      
        ed60b1644e7f7e5dd67d21caf7e4425dff05dad0
      
      intended to do this but moved it into truncate_hole to cover more
      cases.  However, a deadlock scenario is possible when deleting an inode
      entry under specific conditions:
      
       f2fs_delete_entry()
           mutex_lock_op(sbi, DENTRY_OPS);
           truncate_hole()
               f2fs_balance_fs()
                   mutex_lock(&sbi->gc_mutex);
                   f2fs_gc()
                       write_checkpoint()
                           block_operations()
                               mutex_lock_op(sbi, DENTRY_OPS);
      
      Lets move it into the punch_hole case to cover the original intent of
      avoiding it during fallocate's expand_inode_data case.
      
      Change-Id: I29f8ea1056b0b88b70ba8652d901b6e8431bb27e
      Signed-off-by: default avatarJason Hrycay <jason.hrycay@motorola.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      1127a3d4
  2. 03 Apr, 2013 12 commits
  3. 31 Mar, 2013 1 commit
  4. 27 Mar, 2013 4 commits
  5. 20 Mar, 2013 11 commits
  6. 18 Mar, 2013 8 commits
  7. 08 Mar, 2013 1 commit
  8. 07 Mar, 2013 1 commit
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 47b3bc90
      Linus Torvalds authored
      Pull x86 fixes from Peter Anvin:
       "Several boot fixes (MacBook, legacy EFI bootloaders), another
        please-don't-brick fix, and some minor stuff."
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86: Do not try to sync identity map for non-mapped pages
        x86, doc: Be explicit about what the x86 struct boot_params requires
        x86: Don't clear efi_info even if the sentinel hits
        x86, mm: Make sure to find a 2M free block for the first mapped area
        x86: Fix 32-bit *_cpu_data initializers
        efivarfs: return accurate error code in efivarfs_fill_super()
        efivars: efivarfs_valid_name() should handle pstore syntax
        efi: be more paranoid about available space when creating variables
        iommu, x86: Add DMA remap fault reason
        x86, smpboot: Remove unused variable
      47b3bc90