1. 07 2月, 2008 3 次提交
  2. 19 10月, 2007 1 次提交
    • C
      [XFS] cleanup fid types mess · c6143911
      Christoph Hellwig 提交于
      Currently XFs has three different fid types: struct fid, struct xfs_fid
      and struct xfs_fid2 with hte latter two beeing identicaly and the first
      one beeing the same size but an unstructured array with the same size.
      
      This patch consolidates all this to alway uuse struct xfs_fid.
      
      This patch is required for an upcoming patch series from me that revamps
      the nfs exporting code and introduces a Linux-wide struct fid.
      
      SGI-PV: 970336
      SGI-Modid: xfs-linux-melb:xfs-kern:29651a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      c6143911
  3. 16 10月, 2007 11 次提交
  4. 15 10月, 2007 5 次提交
    • V
      [XFS] do not have XFSMNT_IDELETE as default when mounted with XFSMNT_DMAPI · b93bd20c
      Vlad Apostolov 提交于
      XFS inodes are dynamically allocated on demand, rather than being
      allocated at mkfs time. Chunks of 64 inodes are allocated at once, but
      they are never freed. Over time, this can lead to filesystem
      fragmentation, clusters of inodes and the btrees which point at them can
      be scattered around the system.
      
      By freeing clusters as they are emptied, we will reduce fragmentation of
      the free space after removing files. This in turn will allow us to make
      better placement decisions when repopulating a filesystem. The
      XFSMNT_IDELETE mount option enables freeing clusters when they get empty.
      
      Unfortunately a side effect of freeing inode clusters is that the inode
      generation numbers of such inodes would be reset to zero when the cluster
      is reclaimed. This is a problem in particular for a DMAPI enabled
      filesystem as the the DMAPI handles need to be unique and persistent in
      time. An unique DMAPI handle is built with the help of the inode
      generation number. When the last one is prematurely reset by an inode
      cluster reclaim, there is a high probability of different generation
      inodes to end up having identical DMAPI handles.
      
      To avoid the problem with identical DMAPI handles, the XFSMNT_IDELETE
      mount option should be set as default, only if the filesystem is not
      mounted with XFSMNT_DMAPI.
      
      SGI-PV: 969192
      SGI-Modid: xfs-linux-melb:xfs-kern:29486a
      Signed-off-by: NVlad Apostolov <vapo@sgi.com>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NMark Goodwin <markgw@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      b93bd20c
    • 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
    • E
      [XFS] optimize dmapi event tests w/o dmapi config · 948c6d4f
      Eric Sandeen 提交于
      SGI-PV: 969372
      SGI-Modid: xfs-linux-melb:xfs-kern:29444a
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NVlad Apostolov <vapo@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      948c6d4f
    • 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] clean up xfs_start_flags · dcb3b83f
      Eric Sandeen 提交于
      xfs_start_flags can make use of is_power_of_2 to tidy up the test a little
      bit.
      
      SGI-PV: 968563
      SGI-Modid: xfs-linux-melb:xfs-kern:29327a
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      dcb3b83f
  5. 14 7月, 2007 4 次提交
    • D
      [XFS] Concurrent Multi-File Data Streams · 2a82b8be
      David Chinner 提交于
      In media spaces, video is often stored in a frame-per-file format. When
      dealing with uncompressed realtime HD video streams in this format, it is
      crucial that files do not get fragmented and that multiple files a placed
      contiguously on disk.
      
      When multiple streams are being ingested and played out at the same time,
      it is critical that the filesystem does not cross the streams and
      interleave them together as this creates seek and readahead cache miss
      latency and prevents both ingest and playout from meeting frame rate
      targets.
      
      This patch set creates a "stream of files" concept into the allocator to
      place all the data from a single stream contiguously on disk so that RAID
      array readahead can be used effectively. Each additional stream gets
      placed in different allocation groups within the filesystem, thereby
      ensuring that we don't cross any streams. When an AG fills up, we select a
      new AG for the stream that is not in use.
      
      The core of the functionality is the stream tracking - each inode that we
      create in a directory needs to be associated with the directories' stream.
      Hence every time we create a file, we look up the directories' stream
      object and associate the new file with that object.
      
      Once we have a stream object for a file, we use the AG that the stream
      object point to for allocations. If we can't allocate in that AG (e.g. it
      is full) we move the entire stream to another AG. Other inodes in the same
      stream are moved to the new AG on their next allocation (i.e. lazy
      update).
      
      Stream objects are kept in a cache and hold a reference on the inode.
      Hence the inode cannot be reclaimed while there is an outstanding stream
      reference. This means that on unlink we need to remove the stream
      association and we also need to flush all the associations on certain
      events that want to reclaim all unreferenced inodes (e.g. filesystem
      freeze).
      
      SGI-PV: 964469
      SGI-Modid: xfs-linux-melb:xfs-kern:29096a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NBarry Naujok <bnaujok@sgi.com>
      Signed-off-by: NDonald Douwsma <donaldd@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      Signed-off-by: NVlad Apostolov <vapo@sgi.com>
      2a82b8be
    • D
      [XFS] Fix remount,readonly path to flush everything correctly. · 516b2e7c
      David Chinner 提交于
      The remount readonly path can fail to writeback properly because we still
      have active transactions after calling xfs_quiesce_fs(). Further
      investigation shows that this path is broken in the same ways that the xfs
      freeze path was broken so fix it the same way.
      
      SGI-PV: 964464
      SGI-Modid: xfs-linux-melb:xfs-kern:28869a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      516b2e7c
    • 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
    • D
      [XFS] Sleeping with the ilock waiting for I/O completion is Bad. · 40095b64
      David Chinner 提交于
      Recent fixes to the filesystem freezing code introduced a vn_iowait call
      in the middle of the sync code. Unfortunately, at the point where this
      call was added we are holding the ilock. The ilock is needed by I/O
      completion for unwritten extent conversion and now updating the file size.
      Hence I/o cannot complete if we hold the ilock while waiting for I/O
      completion.
      
      Fix up the bug and clean the code up around it.
      
      SGI-PV: 963674
      SGI-Modid: xfs-linux-melb:xfs-kern:28566a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      40095b64
  6. 08 5月, 2007 3 次提交
  7. 10 2月, 2007 4 次提交
  8. 28 9月, 2006 1 次提交
  9. 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
  10. 28 7月, 2006 1 次提交
  11. 20 6月, 2006 1 次提交
  12. 09 6月, 2006 5 次提交