1. 07 1月, 2011 2 次提交
    • N
      fs: icache RCU free inodes · fa0d7e3d
      Nick Piggin 提交于
      RCU free the struct inode. This will allow:
      
      - Subsequent store-free path walking patch. The inode must be consulted for
        permissions when walking, so an RCU inode reference is a must.
      - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
        to take i_lock no longer need to take sb_inode_list_lock to walk the list in
        the first place. This will simplify and optimize locking.
      - Could remove some nested trylock loops in dcache code
      - Could potentially simplify things a bit in VM land. Do not need to take the
        page lock to follow page->mapping.
      
      The downsides of this is the performance cost of using RCU. In a simple
      creat/unlink microbenchmark, performance drops by about 10% due to inability to
      reuse cache-hot slab objects. As iterations increase and RCU freeing starts
      kicking over, this increases to about 20%.
      
      In cases where inode lifetimes are longer (ie. many inodes may be allocated
      during the average life span of a single inode), a lot of this cache reuse is
      not applicable, so the regression caused by this patch is smaller.
      
      The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
      however this adds some complexity to list walking and store-free path walking,
      so I prefer to implement this at a later date, if it is shown to be a win in
      real situations. I haven't found a regression in any non-micro benchmark so I
      doubt it will be a problem.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fa0d7e3d
    • N
      fs: dcache scale dentry refcount · b7ab39f6
      Nick Piggin 提交于
      Make d_count non-atomic and protect it with d_lock. This allows us to ensure a
      0 refcount dentry remains 0 without dcache_lock. It is also fairly natural when
      we start protecting many other dentry members with d_lock.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      b7ab39f6
  2. 29 10月, 2010 1 次提交
  3. 23 10月, 2010 17 次提交
  4. 05 10月, 2010 2 次提交
    • J
      BKL: Remove BKL from NILFS2 · d6d4c19c
      Jan Blunck 提交于
      The BKL is only used in put_super, fill_super and remount_fs that are all
      three protected by the superblocks s_umount rw_semaphore. Therefore it is
      safe to remove the BKL entirely.
      Signed-off-by: NJan Blunck <jblunck@infradead.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      d6d4c19c
    • J
      BKL: Explicitly add BKL around get_sb/fill_super · db719222
      Jan Blunck 提交于
      This patch is a preparation necessary to remove the BKL from do_new_mount().
      It explicitly adds calls to lock_kernel()/unlock_kernel() around
      get_sb/fill_super operations for filesystems that still uses the BKL.
      
      I've read through all the code formerly covered by the BKL inside
      do_kern_mount() and have satisfied myself that it doesn't need the BKL
      any more.
      
      do_kern_mount() is already called without the BKL when mounting the rootfs
      and in nfsctl. do_kern_mount() calls vfs_kern_mount(), which is called
      from various places without BKL: simple_pin_fs(), nfs_do_clone_mount()
      through nfs_follow_mountpoint(), afs_mntpt_do_automount() through
      afs_mntpt_follow_link(). Both later functions are actually the filesystems
      follow_link inode operation. vfs_kern_mount() is calling the specified
      get_sb function and lets the filesystem do its job by calling the given
      fill_super function.
      
      Therefore I think it is safe to push down the BKL from the VFS to the
      low-level filesystems get_sb/fill_super operation.
      
      [arnd: do not add the BKL to those file systems that already
             don't use it elsewhere]
      Signed-off-by: NJan Blunck <jblunck@infradead.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Christoph Hellwig <hch@infradead.org>
      db719222
  5. 10 9月, 2010 1 次提交
  6. 18 8月, 2010 1 次提交
  7. 16 8月, 2010 1 次提交
    • R
      nilfs2: fix list corruption after ifile creation failure · af4e3631
      Ryusuke Konishi 提交于
      If nilfs_attach_checkpoint() gets a memory allocation failure during
      creation of ifile, it will return without removing nilfs_sb_info
      struct from ns_supers list.  When a concurrently mounted snapshot is
      unmounted or another new snapshot is mounted after that, this causes
      kernel oops as below:
      
      > BUG: unable to handle kernel NULL pointer dereference at (null)
      > IP: [<f83662ff>] nilfs_find_sbinfo+0x74/0xa4 [nilfs2]
      > *pde = 00000000
      > Oops: 0000 [#1] SMP
      <snip>
      > Call Trace:
      >  [<f835dc29>] ? nilfs_get_sb+0x165/0x532 [nilfs2]
      >  [<c1173c87>] ? ida_get_new_above+0x16d/0x187
      >  [<c109a7f8>] ? alloc_vfsmnt+0x7e/0x10a
      >  [<c1070790>] ? kstrdup+0x2c/0x40
      >  [<c1089041>] ? vfs_kern_mount+0x96/0x14e
      >  [<c108913d>] ? do_kern_mount+0x32/0xbd
      >  [<c109b331>] ? do_mount+0x642/0x6a1
      >  [<c101a415>] ? do_page_fault+0x0/0x2d1
      >  [<c1099c00>] ? copy_mount_options+0x80/0xe2
      >  [<c10705d8>] ? strndup_user+0x48/0x67
      >  [<c109b3f1>] ? sys_mount+0x61/0x90
      >  [<c10027cc>] ? sysenter_do_call+0x12/0x22
      
      This fixes the problem.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Tested-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Cc: stable@kernel.org
      af4e3631
  8. 10 8月, 2010 1 次提交
  9. 23 7月, 2010 12 次提交
  10. 31 5月, 2010 1 次提交
  11. 10 5月, 2010 1 次提交
    • R
      nilfs2: disallow remount of snapshot from/to a regular mount · d240e067
      Ryusuke Konishi 提交于
      Snapshots and regular ro/rw mounts are essentially-different within
      the meaning whether the checkpoint is static or not and is marked with
      a snapshot flag or not.
      
      The current implemenation, however, allows to remount a snapshot to a
      regular rw-mount if the checkpoint number equals the latest one.
      
      This transition is actually impossible since changing a checkpoint to
      a snapshot makes another checkpoint, thus the condition is never
      satisfied.
      
      This fixes the weird state of affairs, and specifically separates
      snapshots and regular rw/ro-mounts.
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      d240e067