linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* reduce dmesg spam
@ 2020-02-20  4:05 Christoph Hellwig
  2020-02-20  4:05 ` [PATCH 1/2] xfs: ratelimit xfs_buf_ioerror_alert Christoph Hellwig
  2020-02-20  4:05 ` [PATCH 2/2] xfs: ratelimit xfs_discard_page alert messages Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2020-02-20  4:05 UTC (permalink / raw)
  To: linux-xfs

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] xfs: ratelimit xfs_buf_ioerror_alert
  2020-02-20  4:05 reduce dmesg spam Christoph Hellwig
@ 2020-02-20  4:05 ` Christoph Hellwig
  2020-02-20 14:12   ` Brian Foster
  2020-02-20  4:05 ` [PATCH 2/2] xfs: ratelimit xfs_discard_page alert messages Christoph Hellwig
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2020-02-20  4:05 UTC (permalink / raw)
  To: linux-xfs

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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_buf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 217e4f82a44a..e010680a665e 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -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,
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] xfs: ratelimit xfs_discard_page alert messages
  2020-02-20  4:05 reduce dmesg spam Christoph Hellwig
  2020-02-20  4:05 ` [PATCH 1/2] xfs: ratelimit xfs_buf_ioerror_alert Christoph Hellwig
@ 2020-02-20  4:05 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2020-02-20  4:05 UTC (permalink / raw)
  To: linux-xfs

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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_aops.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 58e937be24ce..acdda808fbdd 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -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));
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] xfs: ratelimit xfs_buf_ioerror_alert
  2020-02-20  4:05 ` [PATCH 1/2] xfs: ratelimit xfs_buf_ioerror_alert Christoph Hellwig
@ 2020-02-20 14:12   ` Brian Foster
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Foster @ 2020-02-20 14:12 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-xfs

On Wed, Feb 19, 2020 at 08:05:48PM -0800, Christoph Hellwig wrote:
> 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.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/xfs/xfs_buf.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 217e4f82a44a..e010680a665e 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1238,6 +1238,8 @@ xfs_buf_ioerror_alert(
>  	struct xfs_buf		*bp,
>  	xfs_failaddr_t		func)
>  {
> +	if (!printk_ratelimit())
> +		return;

xfs_alert_ratelimited() ?

Brian

>  	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,
> -- 
> 2.24.1
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-20 14:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20  4:05 reduce dmesg spam Christoph Hellwig
2020-02-20  4:05 ` [PATCH 1/2] xfs: ratelimit xfs_buf_ioerror_alert Christoph Hellwig
2020-02-20 14:12   ` Brian Foster
2020-02-20  4:05 ` [PATCH 2/2] xfs: ratelimit xfs_discard_page alert messages Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).