reduce dmesg spam
Hi all,
When a device keeps failing I/O (for example using dm-flakey in various tests), we keep spamming the log for each I/O error, although the messages are very much duplicates. Use printk_ratelimit() to reduce the number of logged lines.
PATCH 1/2 xfs: ratelimit xfs_buf_ioerror_alert
Use printk_ratelimit() to limit the amount of messages printed from xfs_buf_ioerror_alert. Without that a failing device causes a large number of errors that doesn't really help debugging the underling issue.
--- fs/xfs/xfs_buf.c | 2 ++ 1 file changed, 2 insertions(+)
fs/xfs/xfs_buf.c +2 -0
@@ -1238,6 +1238,8 @@ xfs_buf_ioerror_alert( struct xfs_buf *bp, xfs_failaddr_t func) { +if (!printk_ratelimit ()) +return ; xfs_alert(bp->b_mount, "metadata I/O error in \"%pS\" at daddr 0x%llx len %d error %d", func, (uint64_t)XFS_BUF_ADDR(bp), bp->b_length,
Signature · 1 line
2.24.1
Re: [PATCH 1/2] xfs: ratelimit xfs_buf_ioerror_alert
Quoted 15 lines · Christoph Hellwig
Use
printk_ratelimit()to limit the amount of messages printed fromxfs_buf_ioerror_alert. Without that a failing device causes a large number of errors that doesn't really help debugging the underling issue.Signed-off-by Christoph Hellwig <[email protected]>--- fs/xfs/xfs_buf.c | 2 ++ 1 file changed, 2 insertions(+)fs/xfs/xfs_buf.c +0
-0
fs/xfs/xfs_buf.c xfs_buf_ioerror_alert( · line 1242
Quoted 5 lines
fs/xfs/xfs_buf.c +2
-0@@ -1238,6 +1238,8 @@ xfs_buf_ioerror_alert( struct xfs_buf *bp, xfs_failaddr_t func) { +if (!printk_ratelimit ()) +return ;
xfs_alert_ratelimited() ?
Brian
Quoted 6 lines
fs/xfs/xfs_buf.c +0
-0xfs_alert(bp->b_mount, "metadata I/O error in \"%pS\" at daddr 0x%llx len %d error %d", func, (uint64_t)XFS_BUF_ADDR(bp), bp->b_length,Signature · 1 line
2.24.1
PATCH 2/2 xfs: ratelimit xfs_discard_page alert messages
In reply to Christoph HellwigUse printk_ratelimit() to limit the amount of messages printed from xfs_discard_page. Without that a failing device causes a large number of errors that doesn't really help debugging the underling issue.
--- fs/xfs/xfs_aops.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/xfs/xfs_aops.c +4 -3
@@ -539,9 +539,10 @@ xfs_discard_page(if (XFS_FORCED_SHUTDOWN (mp)) goto out_invalidate; -xfs_alert (mp, -"page discard on page " PTR_FMT ", inode 0x%llx, offset %llu." , - page, ip->i_ino, offset); +if (printk_ratelimit ()) +xfs_alert (mp, +"page discard on page " PTR_FMT ", inode 0x%llx, offset %llu." , + page, ip->i_ino, offset); error =xfs_bmap_punch_delalloc_range (ip, start_fsb,PAGE_SIZE /i_blocksize (inode));
Signature · 1 line
2.24.1