1. 27 May, 2020 2 commits
    • Dave Chinner's avatar
      xfs: reduce free inode accounting overhead · f18c9a90
      Dave Chinner authored
      Shaokun Zhang reported that XFS was using substantial CPU time in
      percpu_count_sum() when running a single threaded benchmark on
      a high CPU count (128p) machine from xfs_mod_ifree(). The issue
      is that the filesystem is empty when the benchmark runs, so inode
      allocation is running with a very low inode free count.
      
      With the percpu counter batching, this means comparisons when the
      counter is less that 128 * 256 = 32768 use the slow path of adding
      up all the counters across the CPUs, and this is expensive on high
      CPU count machines.
      
      The summing in xfs_mod_ifree() is only used to fire an assert if an
      underrun occurs. The error is ignored by the higher level code.
      Hence this is really just debug code and we don't need to run it
      on production kernels, nor do we need such debug checks to return
      error values just to trigger an assert.
      
      Finally, xfs_mod_icount/xfs_mod_ifree are only called from
      xfs_trans_unreserve_and_mod_sb(), so get rid of them and just
      directly call the percpu_counter_add/percpu_counter_compare
      functions. The compare functions are now run only on debug builds as
      they are internal to ASSERT() checks and so only compiled in when
      ASSERTs are active (CONFIG_XFS_DEBUG=y or CONFIG_XFS_WARN=y).
      Reported-by: default avatarShaokun Zhang <zhangshaokun@hisilicon.com>
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      f18c9a90
    • Dave Chinner's avatar
      xfs: gut error handling in xfs_trans_unreserve_and_mod_sb() · dc3ffbb1
      Dave Chinner authored
      xfs: gut error handling in xfs_trans_unreserve_and_mod_sb()
      
      From: Dave Chinner <dchinner@redhat.com>
      
      The error handling in xfs_trans_unreserve_and_mod_sb() is largely
      incorrect - rolling back the changes in the transaction if only one
      counter underruns makes all the other counters incorrect. We still
      allow the change to proceed and committing the transaction, except
      now we have multiple incorrect counters instead of a single
      underflow.
      
      Further, we don't actually report the error to the caller, so this
      is completely silent except on debug kernels that will assert on
      failure before we even get to the rollback code.  Hence this error
      handling is broken, untested, and largely unnecessary complexity.
      
      Just remove it.
      Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      dc3ffbb1
  2. 19 May, 2020 22 commits
  3. 13 May, 2020 3 commits
  4. 08 May, 2020 13 commits