xfs: refactor ratelimited buffer error messages into helper
authorBrian Foster <bfoster@redhat.com>
Wed, 6 May 2020 20:25:21 +0000 (13:25 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 7 May 2020 15:27:46 +0000 (08:27 -0700)
commitf9bccfcc3b59b9aba64791ab3a2bfefe681ab75b
tree4dae95522900ae8177e3e860b0fc6c63df202d12
parentb6983e80b03bd4fd42de71993b3ac7403edac758
xfs: refactor ratelimited buffer error messages into helper

XFS has some inconsistent log message rate limiting with respect to
buffer alerts. The metadata I/O error notification uses the generic
ratelimited alert, the buffer push code uses a custom rate limit and
the similar quiesce time failure checks are not rate limited at all
(when they should be).

The custom rate limit defined in the buf item code is specifically
crafted for buffer alerts. It is more aggressive than generic rate
limiting code because it must accommodate a high frequency of I/O
error events in a relative short timeframe.

Factor out the custom rate limit state from the buf item code into a
per-buftarg rate limit so various alerts are limited based on the
target. Define a buffer alert helper function and use it for the
buffer alerts that are already ratelimited.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Allison Collins <allison.henderson@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_message.c
fs/xfs/xfs_message.h