1. 16 10月, 2007 1 次提交
  2. 15 10月, 2007 5 次提交
    • D
      [XFS] Radix tree based inode caching · da353b0d
      David Chinner 提交于
      One of the perpetual scaling problems XFS has is indexing it's incore
      inodes. We currently uses hashes and the default hash sizes chosen can
      only ever be a tradeoff between memory consumption and the maximum
      realistic size of the cache.
      
      As a result, anyone who has millions of inodes cached on a filesystem
      needs to tunes the size of the cache via the ihashsize mount option to
      allow decent scalability with inode cache operations.
      
      A further problem is the separate inode cluster hash, whose size is based
      on the ihashsize but is smaller, and so under certain conditions (sparse
      cluster cache population) this can become a limitation long before the
      inode hash is causing issues.
      
      The following patchset removes the inode hash and cluster hash and
      replaces them with radix trees to avoid the scalability limitations of the
      hashes. It also reduces the size of the inodes by 3 pointers....
      
      SGI-PV: 969561
      SGI-Modid: xfs-linux-melb:xfs-kern:29481a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      da353b0d
    • C
      [XFS] superblock endianess annotations · 2bdf7cd0
      Christoph Hellwig 提交于
      Creates a new xfs_dsb_t that is __be annotated and keeps xfs_sb_t for the
      incore one. xfs_xlatesb is renamed to xfs_sb_to_disk and only handles the
      incore -> disk conversion. A new helper xfs_sb_from_disk handles the other
      direction and doesn't need the slightly hacky table-driven approach
      because we only ever read the full sb from disk.
      
      The handling of shared r/o filesystems has been buggy on little endian
      system and fixing this required shuffling around of some code in that
      area.
      
      SGI-PV: 968563
      SGI-Modid: xfs-linux-melb:xfs-kern:29477a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      2bdf7cd0
    • J
      [XFS] Fix a potential NULL pointer deref in XFS on failed mount. · 49ee6c91
      Jesper Juhl 提交于
      If we fail to open the the log device buftarg, we can fall through to
      error handling code that fails to check for a NULL log device buftarg
      before calling xfs_free_buftarg().
      
      This patch fixes the issue by checking mp->m_logdev_targp against NULL in
      xfs_unmountfs_close() and doing the proper xfs_blkdev_put(logdev); and
      xfs_blkdev_put(rtdev); on (!mp->m_rtdev_targp) in xfs_mount().
      
      Discovered by the Coverity checker.
      
      SGI-PV: 968563
      SGI-Modid: xfs-linux-melb:xfs-kern:29328a
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      49ee6c91
    • E
      [XFS] Pick a single default inode cluster size. · 425f9ddd
      Eric Sandeen 提交于
      Remove scaling of inode "clusters" based on machine memory; small cluster
      cut-point was an unrealistic 32MB and was probably never tested.
      
      Removes another user of xfs_physmem.
      
      SGI-PV: 968563
      SGI-Modid: xfs-linux-melb:xfs-kern:29324a
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      425f9ddd
    • E
      [XFS] Remove m_nreadaheads · 40906630
      Eric Sandeen 提交于
      m_nreadaheads in the mount struct is never used; remove it and the various
      macros assigned to it. Also remove a couple other unused macros in the
      same areas.
      
      Removes one user of xfs_physmem.
      
      SGI-PV: 968563
      SGI-Modid: xfs-linux-melb:xfs-kern:29322a
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      40906630
  3. 14 7月, 2007 5 次提交
    • C
      [XFS] Use do_div() on 64 bit types. · 39726be2
      Christoph Hellwig 提交于
      SGI-PV: 966145
      SGI-Modid: xfs-linux-melb:xfs-kern:28889a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      39726be2
    • D
      [XFS] Prevent ENOSPC from aborting transactions that need to succeed · 84e1e99f
      David Chinner 提交于
      During delayed allocation extent conversion or unwritten extent
      conversion, we need to reserve some blocks for transactions reservations.
      We need to reserve these blocks in case a btree split occurs and we need
      to allocate some blocks.
      
      Unfortunately, we've only ever reserved the number of data blocks we are
      allocating, so in both the unwritten and delalloc case we can get ENOSPC
      to the transaction reservation. This is bad because in both cases we
      cannot report the failure to the writing application.
      
      The fix is two-fold:
      
      1 - leverage the reserved block infrastructure XFS already
      has to reserve a small pool of blocks by default to allow
      specially marked transactions to dip into when we are at
      ENOSPC.
      Default setting is min(5%, 1024 blocks).
      
      2 - convert critical transaction reservations to be allowed
      to dip into this pool. Spots changed are delalloc
      conversion, unwritten extent conversion and growing a
      filesystem at ENOSPC.
      This also allows growing the filesytsem to succeed at ENOSPC.
      
      SGI-PV: 964468
      SGI-Modid: xfs-linux-melb:xfs-kern:28865a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      84e1e99f
    • D
      [XFS] Prevent deadlock when flushing inodes on unmount · 641c56fb
      David Chinner 提交于
      When we are unmounting the filesystem, we flush all the inodes to disk.
      Unfortunately, if we have an inode cluster that has just been freed and
      marked stale sitting in an incore log buffer (i.e. hasn't been flushed to
      disk), it will be holding all the flush locks on the inodes in that
      cluster.
      
      xfs_iflush_all() which is called during unmount walks all the inodes
      trying to reclaim them, and it doing so calls xfs_finish_reclaim() on each
      inode. If the inode is dirty, if grabs the flush lock and flushes it.
      Unfortunately, find dirty inodes that already have their flush lock held
      and so we sleep.
      
      At this point in the unmount process, we are running single-threaded.
      There is nothing more that can push on the log to force the transaction
      holding the inode flush locks to disk and hence we deadlock.
      
      The fix is to issue a log force before flushing the inodes on unmount so
      that all the flush locks will be released before we start flushing the
      inodes.
      
      SGI-PV: 964538
      SGI-Modid: xfs-linux-melb:xfs-kern:28862a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      641c56fb
    • D
      [XFS] Lazy Superblock Counters · 92821e2b
      David Chinner 提交于
      When we have a couple of hundred transactions on the fly at once, they all
      typically modify the on disk superblock in some way.
      create/unclink/mkdir/rmdir modify inode counts, allocation/freeing modify
      free block counts.
      
      When these counts are modified in a transaction, they must eventually lock
      the superblock buffer and apply the mods. The buffer then remains locked
      until the transaction is committed into the incore log buffer. The result
      of this is that with enough transactions on the fly the incore superblock
      buffer becomes a bottleneck.
      
      The result of contention on the incore superblock buffer is that
      transaction rates fall - the more pressure that is put on the superblock
      buffer, the slower things go.
      
      The key to removing the contention is to not require the superblock fields
      in question to be locked. We do that by not marking the superblock dirty
      in the transaction. IOWs, we modify the incore superblock but do not
      modify the cached superblock buffer. In short, we do not log superblock
      modifications to critical fields in the superblock on every transaction.
      In fact we only do it just before we write the superblock to disk every
      sync period or just before unmount.
      
      This creates an interesting problem - if we don't log or write out the
      fields in every transaction, then how do the values get recovered after a
      crash? the answer is simple - we keep enough duplicate, logged information
      in other structures that we can reconstruct the correct count after log
      recovery has been performed.
      
      It is the AGF and AGI structures that contain the duplicate information;
      after recovery, we walk every AGI and AGF and sum their individual
      counters to get the correct value, and we do a transaction into the log to
      correct them. An optimisation of this is that if we have a clean unmount
      record, we know the value in the superblock is correct, so we can avoid
      the summation walk under normal conditions and so mount/recovery times do
      not change under normal operation.
      
      One wrinkle that was discovered during development was that the blocks
      used in the freespace btrees are never accounted for in the AGF counters.
      This was once a valid optimisation to make; when the filesystem is full,
      the free space btrees are empty and consume no space. Hence when it
      matters, the "accounting" is correct. But that means the when we do the
      AGF summations, we would not have a correct count and xfs_check would
      complain. Hence a new counter was added to track the number of blocks used
      by the free space btrees. This is an *on-disk format change*.
      
      As a result of this, lazy superblock counters are a mkfs option and at the
      moment on linux there is no way to convert an old filesystem. This is
      possible - xfs_db can be used to twiddle the right bits and then
      xfs_repair will do the format conversion for you. Similarly, you can
      convert backwards as well. At some point we'll add functionality to
      xfs_admin to do the bit twiddling easily....
      
      SGI-PV: 964999
      SGI-Modid: xfs-linux-melb:xfs-kern:28652a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      92821e2b
    • N
      [XFS] Don't grow filesystems past the size they can index. · 4cc929ee
      Nathan Scott 提交于
      When growing a filesystem we don't check to see if the new size overflows
      the page cache index range, so we can do silly things like grow a
      filesystem page 16TB on a 32bit. Check new filesystem sizes against the
      limits the kernel can support.
      
      SGI-PV: 957886
      SGI-Modid: xfs-linux-melb:xfs-kern:28563a
      Signed-Off-By: NNathan Scott <nscott@aconex.com>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      4cc929ee
  4. 10 5月, 2007 1 次提交
    • R
      Add suspend-related notifications for CPU hotplug · 8bb78442
      Rafael J. Wysocki 提交于
      Since nonboot CPUs are now disabled after tasks and devices have been
      frozen and the CPU hotplug infrastructure is used for this purpose, we need
      special CPU hotplug notifications that will help the CPU-hotplug-aware
      subsystems distinguish normal CPU hotplug events from CPU hotplug events
      related to a system-wide suspend or resume operation in progress.  This
      patch introduces such notifications and causes them to be used during
      suspend and resume transitions.  It also changes all of the
      CPU-hotplug-aware subsystems to take these notifications into consideration
      (for now they are handled in the same way as the corresponding "normal"
      ones).
      
      [oleg@tv-sign.ru: cleanups]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8bb78442
  5. 08 5月, 2007 1 次提交
  6. 10 2月, 2007 6 次提交
  7. 07 9月, 2006 1 次提交
    • D
      [XFS] Prevent free space oversubscription and xfssyncd looping. · 4be536de
      David Chinner 提交于
      The fix for recent ENOSPC deadlocks introduced certain limitations on
      allocations. The fix could cause xfssyncd to loop endlessly if we did not
      leave some space free for the allocator to work correctly. Basically, we
      needed to ensure that we had at least 4 blocks free for an AG free list
      and a block for the inode bmap btree at all times.
      
      However, this did not take into account the fact that each AG has a free
      list that needs 4 blocks. Hence any filesystem with more than one AG could
      cause oversubscription of free space and make xfssyncd spin forever trying
      to allocate space needed for AG freelists that was not available in the
      AG.
      
      The following patch reserves space for the free lists in all AGs plus the
      inode bmap btree which prevents oversubscription. It also prevents those
      blocks from being reported as free space (as they can never be used) and
      makes the SMP in-core superblock accounting code and the reserved block
      ioctl respect this requirement.
      
      SGI-PV: 955674
      SGI-Modid: xfs-linux-melb:xfs-kern:26894a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NDavid Chatterton <chatz@sgi.com>
      4be536de
  8. 28 6月, 2006 2 次提交
  9. 20 6月, 2006 1 次提交
  10. 09 6月, 2006 4 次提交
  11. 11 4月, 2006 1 次提交
  12. 31 3月, 2006 1 次提交
  13. 29 3月, 2006 1 次提交
  14. 14 3月, 2006 4 次提交
  15. 15 1月, 2006 1 次提交
  16. 11 1月, 2006 2 次提交
  17. 10 1月, 2006 1 次提交
  18. 02 11月, 2005 2 次提交