Skip to content
  1. Feb 04, 2009
    • Chris Mason's avatar
      Btrfs: Change btree locking to use explicit blocking points · b4ce94de
      Chris Mason authored
      
      
      Most of the btrfs metadata operations can be protected by a spinlock,
      but some operations still need to schedule.
      
      So far, btrfs has been using a mutex along with a trylock loop,
      most of the time it is able to avoid going for the full mutex, so
      the trylock loop is a big performance gain.
      
      This commit is step one for getting rid of the blocking locks entirely.
      btrfs_tree_lock takes a spinlock, and the code explicitly switches
      to a blocking lock when it starts an operation that can schedule.
      
      We'll be able get rid of the blocking locks in smaller pieces over time.
      Tracing allows us to find the most common cause of blocking, so we
      can start with the hot spots first.
      
      The basic idea is:
      
      btrfs_tree_lock() returns with the spin lock held
      
      btrfs_set_lock_blocking() sets the EXTENT_BUFFER_BLOCKING bit in
      the extent buffer flags, and then drops the spin lock.  The buffer is
      still considered locked by all of the btrfs code.
      
      If btrfs_tree_lock gets the spinlock but finds the blocking bit set, it drops
      the spin lock and waits on a wait queue for the blocking bit to go away.
      
      Much of the code that needs to set the blocking bit finishes without actually
      blocking a good percentage of the time.  So, an adaptive spin is still
      used against the blocking bit to avoid very high context switch rates.
      
      btrfs_clear_lock_blocking() clears the blocking bit and returns
      with the spinlock held again.
      
      btrfs_tree_unlock() can be called on either blocking or spinning locks,
      it does the right thing based on the blocking bit.
      
      ctree.c has a helper function to set/clear all the locked buffers in a
      path as blocking.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      b4ce94de
    • Chris Mason's avatar
      Btrfs: hash_lock is no longer needed · c487685d
      Chris Mason authored
      
      
      Before metadata is written to disk, it is updated to reflect that writeout
      has begun.  Once this update is done, the block must be cow'd before it
      can be modified again.
      
      This update was originally synchronized by using a per-fs spinlock.  Today
      the buffers for the metadata blocks are locked before writeout begins,
      and everyone that tests the flag has the buffer locked as well.
      
      So, the per-fs spinlock (called hash_lock for no good reason) is no
      longer required.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      c487685d
    • Chris Mason's avatar
      Btrfs: disable leak debugging checks in extent_io.c · 3935127c
      Chris Mason authored
      
      
      extent_io.c has debugging code to report and free leaked extent_state
      and extent_buffer objects at rmmod time.  This helps track down
      leaks and it saves you from rebooting just to properly remove the
      kmem_cache object.
      
      But, the code runs under a fairly expensive spinlock and the checks to
      see if it is currently enabled are not entirely consistent.  Some use
      #ifdef and some #if.
      
      This changes everything to #if and disables the leak checking.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      3935127c
    • Chris Mason's avatar
      Btrfs: sort references by byte number during btrfs_inc_ref · b7a9f29f
      Chris Mason authored
      
      
      When a block goes through cow, we update the reference counts of
      everything that block points to.  The internal pointers of the block
      can be in just about any order, and it is likely to have clusters of
      things that are close together and clusters of things that are not.
      
      To help reduce the seeks that come with updating all of these reference
      counts, sort them by byte number before actual updates are done.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      b7a9f29f
    • Chris Mason's avatar
      Btrfs: async threads should try harder to find work · b51912c9
      Chris Mason authored
      
      
      Tracing shows the delay between when an async thread goes to sleep
      and when more work is added is often very short.  This commit adds
      a little bit of delay and extra checking to the code right before
      we schedule out.
      
      It allows more work to be added to the worker
      without requiring notifications from other procs.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      b51912c9
    • Jim Owens's avatar
      Btrfs: selinux support · 0279b4cd
      Jim Owens authored
      
      Add call to LSM security initialization and save
      resulting security xattr for new inodes.
      
      Add xattr support to symlink inode ops.
      
      Set inode->i_op for existing special files.
      
      Signed-off-by: default avatarjim owens <jowens@hp.com>
      0279b4cd
    • Christian Hesse's avatar
      Btrfs: make btrfs acls selectable · bef62ef3
      Christian Hesse authored
      
      This patch adds a menu entry to kconfig to enable acls for btrfs.
      This allows you to enable FS_POSIX_ACL at kernel compile time.
      
      (updated by Jeff Mahoney to make the changes in fs/btrfs/Kconfig instead)
      
      Signed-off-by: default avatarChristian Hesse <mail@earthworm.de>
      Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
      bef62ef3
    • Chris Mason's avatar
      Btrfs: Catch missed bios in the async bio submission thread · a6837051
      Chris Mason authored
      
      
      The async bio submission thread was missing some bios that were
      added after it had decided there was no work left to do.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      a6837051
  2. Jan 29, 2009
    • Chris Mason's avatar
      Btrfs: fix readdir on 32 bit machines · 89f135d8
      Chris Mason authored
      
      
      After btrfs_readdir has gone through all the directory items, it
      sets the directory f_pos to the largest possible int.  This way
      applications that mix readdir with creating new files don't
      end up in an endless loop finding the new directory items as they go.
      
      It was a workaround for a bug in git, but the assumption was that if git
      could make this looping mistake than it would be a common problem.
      
      The largest possible int chosen was INT_LIMIT(typeof(file->f_pos),
      and it is possible for that to be a larger number than 32 bit glibc
      expects to come out of readdir.
      
      This patches switches that to INT_LIMIT(off_t), which should keep
      applications happy on 32 and 64 bit machines.
      
      Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
      89f135d8
    • Chris Mason's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable · e4f722fa
      Chris Mason authored
      Fix fs/btrfs/super.c conflict around #includes
      e4f722fa
    • Linus Torvalds's avatar
      Linux 2.6.29-rc3 · 18e352e4
      Linus Torvalds authored
      18e352e4
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · c4568d6c
      Linus Torvalds authored
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc/mm: Fix handling of _PAGE_COHERENT in BAT setup code
        powerpc/pseries: Correct VIO bus accounting problem in CMO env.
        powerpc: More printing warning fixes for the l64 to ll64 conversion
        powerpc: Remove arch/ppc cruft from Kconfig
        powerpc: Printing fix for l64 to ll64 conversion: phyp_dump.c
        powerpc/embedded6xx: Update defconfigs
        powerpc/8xx: Update defconfigs
        powerpc/86xx: Update defconfigs
        powerpc/83xx: Update defconfigs
        powerpc/85xx: Update defconfigs
        powerpc/mpc8313erdb: fix kernel panic because mdio device is not probed
        powerpc/4xx: Update multi-board PowerPC 4xx defconfigs
        powerpc/44x: Update PowerPC 44x defconfigs
        powerpc/40x: Update PowerPC 40x defconfigs
        powerpc/85xx: Fix typo in mpc8572ds dts
        powerpc/44x: Warp patches for the new NDFC driver
        powerpc/4xx: DTS: Add Add'l SDRAM0 Compatible and Interrupt Info
      c4568d6c
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu · 78a768b6
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
        m68knommu: fix 5329 ColdFire periphal addressing
        uclinux: add process name to allocation error message
        m68knommu: correct the mii calculations for 532x ColdFire FEC
        m68knommu: add ColdFire M532x to the FEC configuration options
        m68knommu: fix syscall restarting
        m68knommu: remove the obsolete and long unused comempci chip support
        m68knommu: remove the no longer used PCI support option
        m68knommu: remove obsolete and unused eLIA board
        m68knommu: set NO_DMA
        m68knommu: fix cache flushing for the 527x ColdFire processors
        m68knommu: fix ColdFire 5272 serial baud rates in mcf.c
        m68knommu: use one exist from execption
      78a768b6
  3. Jan 28, 2009