1. 16 May, 2018 8 commits
  2. 10 May, 2018 26 commits
  3. 09 May, 2018 6 commits
    • Darrick J. Wong's avatar
      xfs: bmap debugging should never panic the system · cec57256
      Darrick J. Wong authored
      Don't panic() the system if the bmap records are garbage, just call
      ASSERT which gives us the same backtrace but enables developers to
      control if the system goes down or not.  This makes debugging with
      generic/388 much easier because it won't reboot the machine midway
      through a run just because btree_read_bufl returns EIO when the fs has
      already shut down.
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
      cec57256
    • Brian Foster's avatar
      xfs: defer agfl frees from directory op transactions · 8804630e
      Brian Foster authored
      Directory operations can perform block allocations as entries are
      added/removed from directories. Defer AGFL block frees from the
      remaining directory operation transactions. This covers the hard
      link, remove and rename operations.
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      8804630e
    • Brian Foster's avatar
      xfs: defer frees from common inode allocation paths · 8b922f0e
      Brian Foster authored
      Inode allocation can require block allocation for physical inode
      chunk allocation, inode btree record insertion, and/or directory
      block allocation for entry insertion. Any of these block allocation
      requests can require AGFL fixups prior to the actual allocation.
      Update the common file creation transacions to defer AGFL frees from
      these contexts to avoid too much log reservation consumption
      per-transaction.
      
      Since these transactions are already passed down through the btree
      cursors and da_args structure, this simply requires to attach dfops
      to the transaction. Note that this covers tr_create, tr_mkdir and
      tr_symlink. Other transactions such as tr_create_tmpfile do not
      already make use of deferred operations and so are left alone for
      the time being.
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      8b922f0e
    • Brian Foster's avatar
      xfs: defer agfl frees from inode inactivation · 658f8f95
      Brian Foster authored
      XFS inode chunks are already freed via deferred operations (which
      now also defer AGFL block frees), but inode btree blocks are freed
      directly in the associated context. This has been known to lead to
      log reservation overruns in particular workloads where an inobt
      block free may require several AGFL block frees (and thus several
      allocation btree modifications) before the inobt block itself is
      actually freed.
      
      To avoid this problem, defer the frees of any AGFL blocks before the
      inobt block free takes place. This requires passing the dfops from
      xfs_inactive_ifree() down through the inobt ->[alloc|free]_block()
      callouts, which essentially only requires to attach the dfops to the
      transaction since it is already carried all the way through to the
      inobt update and allocation.
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      658f8f95
    • Brian Foster's avatar
      xfs: defer agfl block frees from deferred ops processing context · 2bc5eba8
      Brian Foster authored
      Now that AGFL block frees are deferred when dfops is set in the
      transaction, start deferring AGFL block frees from contexts that are
      known to push the limits of existing log reservations.
      
      The first such context is deferred operation processing itself. This
      primarily targets deferred extent frees (such as file extents and
      inode chunks), but in doing so covers all allocation operations that
      occur in deferred operation processing context.
      
      Update xfs_defer_finish() to set and reset ->t_agfl_dfops across the
      processing sequence. This means that any AGFL block frees due to
      allocation events result in the addition of new EFIs to the dfops
      rather than being processed immediately. xfs_defer_finish() rolls
      the transaction at least once more to process the frees of the AGFL
      blocks back to the allocation btrees and returns once the AGFL is
      rectified.
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      2bc5eba8
    • Brian Foster's avatar
      xfs: defer agfl block frees when dfops is available · f8f2835a
      Brian Foster authored
      The AGFL fixup code executes before every block allocation/free and
      rectifies the AGFL based on the current, dynamic allocation
      requirements of the fs. The AGFL must hold a minimum number of
      blocks to satisfy a worst case split of the free space btrees caused
      by the impending allocation operation. The AGFL is also updated to
      maintain the implicit requirement for a minimum number of free slots
      to satisfy a worst case join of the free space btrees.
      
      Since the AGFL caches individual blocks, AGFL reduction typically
      involves multiple, single block frees. We've had reports of
      transaction overrun problems during certain workloads that boil down
      to AGFL reduction freeing multiple blocks and consuming more space
      in the log than was reserved for the transaction.
      
      Since the objective of freeing AGFL blocks is to ensure free AGFL
      free slots are available for the upcoming allocation, one way to
      address this problem is to release surplus blocks from the AGFL
      immediately but defer the free of those blocks (similar to how
      file-mapped blocks are unmapped from the file in one transaction and
      freed via a deferred operation) until the transaction is rolled.
      This turns AGFL reduction into an operation with predictable log
      reservation consumption.
      
      Add the capability to defer AGFL block frees when a deferred ops
      list is available to the AGFL fixup code. Add a dfops pointer to the
      transaction to carry dfops through various contexts to the allocator
      context. Deferring AGFL frees is  conditional behavior based on
      whether the transaction pointer is populated. The long term
      objective is to reuse the transaction pointer to clean up all
      unrelated callchains that pass dfops on the stack along with a
      transaction and in doing so, consistently defer AGFL blocks from the
      allocator.
      
      A bit of customization is required to handle deferred completion
      processing because AGFL blocks are accounted against a per-ag
      reservation pool and AGFL blocks are not inserted into the extent
      busy list when freed (they are inserted when used and released back
      to the AGFL). Reuse the majority of the existing deferred extent
      free infrastructure and customize it appropriately to handle AGFL
      blocks.
      
      Note that this patch only adds infrastructure. It does not change
      behavior because no callers have been updated to pass ->t_agfl_dfops
      into the allocation code.
      Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      f8f2835a