1. 14 1月, 2011 2 次提交
  2. 11 1月, 2011 2 次提交
  3. 07 1月, 2011 12 次提交
    • N
      fs: provide rcu-walk aware permission i_ops · b74c79e9
      Nick Piggin 提交于
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      b74c79e9
    • N
      fs: rcu-walk aware d_revalidate method · 34286d66
      Nick Piggin 提交于
      Require filesystems be aware of .d_revalidate being called in rcu-walk
      mode (nd->flags & LOOKUP_RCU). For now do a simple push down, returning
      -ECHILD from all implementations.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      34286d66
    • N
      fs: dcache reduce branches in lookup path · fb045adb
      Nick Piggin 提交于
      Reduce some branches and memory accesses in dcache lookup by adding dentry
      flags to indicate common d_ops are set, rather than having to check them.
      This saves a pointer memory access (dentry->d_op) in common path lookup
      situations, and saves another pointer load and branch in cases where we
      have d_op but not the particular operation.
      
      Patched with:
      
      git grep -E '[.>]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)->d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&\1, \2);/' -i
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fb045adb
    • 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 rationalise dget variants · dc0474be
      Nick Piggin 提交于
      dget_locked was a shortcut to avoid the lazy lru manipulation when we already
      held dcache_lock (lru manipulation was relatively cheap at that point).
      However, how that the lru lock is an innermost one, we never hold it at any
      caller, so the lock cost can now be avoided. We already have well working lazy
      dcache LRU, so it should be fine to defer LRU manipulations to scan time.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      dc0474be
    • N
      fs: dcache remove dcache_lock · b5c84bf6
      Nick Piggin 提交于
      dcache_lock no longer protects anything. remove it.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      b5c84bf6
    • N
      fs: Use rename lock and RCU for multi-step operations · 949854d0
      Nick Piggin 提交于
      The remaining usages for dcache_lock is to allow atomic, multi-step read-side
      operations over the directory tree by excluding modifications to the tree.
      Also, to walk in the leaf->root direction in the tree where we don't have
      a natural d_lock ordering.
      
      This could be accomplished by taking every d_lock, but this would mean a
      huge number of locks and actually gets very tricky.
      
      Solve this instead by using the rename seqlock for multi-step read-side
      operations, retry in case of a rename so we don't walk up the wrong parent.
      Concurrent dentry insertions are not serialised against.  Concurrent deletes
      are tricky when walking up the directory: our parent might have been deleted
      when dropping locks so also need to check and retry for that.
      
      We can also use the rename lock in cases where livelock is a worry (and it
      is introduced in subsequent patch).
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      949854d0
    • N
      fs: dcache scale subdirs · 2fd6b7f5
      Nick Piggin 提交于
      Protect d_subdirs and d_child with d_lock, except in filesystems that aren't
      using dcache_lock for these anyway (eg. using i_mutex).
      
      Note: if we change the locking rule in future so that ->d_child protection is
      provided only with ->d_parent->d_lock, it may allow us to reduce some locking.
      But it would be an exception to an otherwise regular locking scheme, so we'd
      have to see some good results. Probably not worthwhile.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      2fd6b7f5
    • N
      fs: change d_hash for rcu-walk · b1e6a015
      Nick Piggin 提交于
      Change d_hash so it may be called from lock-free RCU lookups. See similar
      patch for d_compare for details.
      
      For in-tree filesystems, this is just a mechanical change.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      b1e6a015
    • N
      fs: change d_compare for rcu-walk · 621e155a
      Nick Piggin 提交于
      Change d_compare so it may be called from lock-free RCU lookups. This
      does put significant restrictions on what may be done from the callback,
      however there don't seem to have been any problems with in-tree fses.
      If some strange use case pops up that _really_ cannot cope with the
      rcu-walk rules, we can just add new rcu-unaware callbacks, which would
      cause name lookup to drop out of rcu-walk mode.
      
      For in-tree filesystems, this is just a mechanical change.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      621e155a
    • N
      fs: name case update method · fb2d5b86
      Nick Piggin 提交于
      smpfs and ncpfs want to update a live dentry name in-place. Rather than
      have them open code the locking, provide a documented dcache API.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fb2d5b86
    • N
      fs: change d_delete semantics · fe15ce44
      Nick Piggin 提交于
      Change d_delete from a dentry deletion notification to a dentry caching
      advise, more like ->drop_inode. Require it to be constant and idempotent,
      and not take d_lock. This is how all existing filesystems use the callback
      anyway.
      
      This makes fine grained dentry locking of dput and dentry lru scanning
      much simpler.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fe15ce44
  4. 05 1月, 2011 1 次提交
  5. 31 12月, 2010 3 次提交
    • R
      [media] staging: se401 depends on USB · ef98a2c0
      Randy Dunlap 提交于
      Fix build errors by adding "depends on USB":
      
      ERROR: "usb_register_driver" [drivers/staging/se401/se401.ko] undefined!
      ERROR: "usb_alloc_urb" [drivers/staging/se401/se401.ko] undefined!
      ERROR: "usb_submit_urb" [drivers/staging/se401/se401.ko] undefined!
      ERROR: "usb_control_msg" [drivers/staging/se401/se401.ko] undefined!
      ERROR: "usb_free_urb" [drivers/staging/se401/se401.ko] undefined!
      ERROR: "usb_kill_urb" [drivers/staging/se401/se401.ko] undefined!
      ERROR: "usb_deregister" [drivers/staging/se401/se401.ko] undefined!
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      ef98a2c0
    • R
      [media] staging: usbvideo/vicam depends on USB · 798cf314
      Randy Dunlap 提交于
      Fix build errors by adding "depends on USB":
      
      ERROR: "usb_register_driver" [drivers/staging/usbvideo/vicam.ko] undefined!
      ERROR: "usb_bulk_msg" [drivers/staging/usbvideo/vicam.ko] undefined!
      ERROR: "usb_control_msg" [drivers/staging/usbvideo/vicam.ko] undefined!
      ERROR: "usb_deregister" [drivers/staging/usbvideo/vicam.ko] undefined!
      ERROR: "usb_get_dev" [drivers/staging/usbvideo/usbvideo.ko] undefined!
      ERROR: "usb_put_dev" [drivers/staging/usbvideo/usbvideo.ko] undefined!
      ERROR: "usb_free_urb" [drivers/staging/usbvideo/usbvideo.ko] undefined!
      ERROR: "usb_submit_urb" [drivers/staging/usbvideo/usbvideo.ko] undefined!
      ERROR: "usb_set_interface" [drivers/staging/usbvideo/usbvideo.ko] undefined!
      ERROR: "usb_kill_urb" [drivers/staging/usbvideo/usbvideo.ko] undefined!
      ERROR: "usb_register_driver" [drivers/staging/usbvideo/usbvideo.ko] undefined!
      ERROR: "usb_deregister" [drivers/staging/usbvideo/usbvideo.ko] undefined!
      ERROR: "usb_alloc_urb" [drivers/staging/usbvideo/usbvideo.ko] undefined!
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      798cf314
    • N
      Revert "Staging: zram: work around oops due to startup ordering snafu" · e983dc24
      Nitin Gupta 提交于
      This reverts commit 7e24cce3 because it
      was never appropriate for mainline.
      
      Do not check for init flag before starting I/O - zram module is unusable
      without this fix.
      
      The oops mentioned in the reverted commit message was actually a problem
      only with the zram version as present in project's own repository where
      we allocate struct zram_stats_cpu upon device initialization.  OTOH, In
      mainline/staging version of zram, we allocate struct stats upfront, so
      this oops cannot happen in mainline version.
      
      Checking for init_done flag in zram_make_request() results in a *no-op*
      for any I/O operation since we simply always return success.  This flag
      is actually set when the first write occurs on a zram disk which
      triggers its initialization.
      
      Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=25722Reported-by: NDennis Jansen <dennis.jansen@web.de>
      Signed-off-by: NNitin Gupta <ngupta@vflare.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e983dc24
  6. 30 12月, 2010 5 次提交
  7. 29 12月, 2010 15 次提交