Skip to contentSkip to conversation

reduce dmesg spam v2

PATCH In review Christoph Hellwig 3 participants 6 messages Feb 20, 2020 – Feb 21, 2020 XFS filesystem

lore
Share & tools
lore
#0 lore raw

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 xfs_alert_ratelimited() to reduce the number of logged lines.

Changes sinve v1:
- use xfs_alert_ratelimited

#1 lore raw

PATCH 1/2 xfs: ratelimit xfs_buf_ioerror_alert messages

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, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_buf.c +1 -1
index 217e4f82a44a..0ceaa172545b 100644
@@ -1238,7 +1238,7 @@ xfs_buf_ioerror_alert(
 	struct xfs_buf		*bp,
 	xfs_failaddr_t		func)
 {
-	xfs_alert(bp->b_mount,
+	xfs_alert_ratelimited(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,
 			-bp->b_error);
Signature · 1 line
2.24.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] xfs: ratelimit xfs_buf_ioerror_alert messages

Quoted 7 lines · Christoph Hellwig

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.

---

Quoted 19 lines
 fs/xfs/xfs_buf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_buf.c +1 -1
index 217e4f82a44a..0ceaa172545b 100644
@@ -1238,7 +1238,7 @@ xfs_buf_ioerror_alert(
 	struct xfs_buf		*bp,
 	xfs_failaddr_t		func)
 {
-	xfs_alert(bp->b_mount,
+	xfs_alert_ratelimited(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,
 			-bp->b_error);
Signature · 1 line
2.24.1
#3 lore raw

PATCH 2/2 xfs: ratelimit xfs_discard_page messages

In reply to Christoph Hellwig

Use 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_aops.c +1 -1
index 58e937be24ce..9d9cebf18726 100644
@@ -539,7 +539,7 @@ xfs_discard_page(
 	if (XFS_FORCED_SHUTDOWN(mp))
 		goto out_invalidate;
 
-	xfs_alert(mp,
+	xfs_alert_ratelimited(mp,
 		"page discard on page "PTR_FMT", inode 0x%llx, offset %llu.",
 			page, ip->i_ino, offset);
 
Signature · 1 line
2.24.1
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] xfs: ratelimit xfs_discard_page messages

Quoted 7 lines · Christoph Hellwig

Use 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.

---

Quoted 19 lines
 fs/xfs/xfs_aops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_aops.c +1 -1
index 58e937be24ce..9d9cebf18726 100644
@@ -539,7 +539,7 @@ xfs_discard_page(
 	if (XFS_FORCED_SHUTDOWN(mp))
 		goto out_invalidate;
 
-	xfs_alert(mp,
+	xfs_alert_ratelimited(mp,
 		"page discard on page "PTR_FMT", inode 0x%llx, offset %llu.",
 			page, ip->i_ino, offset);
 
Signature · 1 line
2.24.1
Reviewed-by
#5 lore raw
In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig

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 xfs_alert_ratelimited() to reduce the number of logged lines.

This series looks ok to me,

--D

Quoted 2 lines

Changes sinve v1:
- use xfs_alert_ratelimited