* [PATCH] block: rate-limit capacity change info log
@ 2025-11-17 5:34 Li Chen
2025-11-17 16:54 ` Bart Van Assche
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Li Chen @ 2025-11-17 5:34 UTC (permalink / raw)
To: Jens Axboe, linux-block, linux-kernel; +Cc: stable
From: Li Chen <chenl311@chinatelecom.cn>
loop devices under heavy stress-ng loop streessor can trigger many
capacity change events in a short time. Each event prints an info
message from set_capacity_and_notify(), flooding the console and
contributing to soft lockups on slow consoles.
Switch the printk in set_capacity_and_notify() to
pr_info_ratelimited() so frequent capacity changes do not spam
the log while still reporting occasional changes.
Cc: stable@vger.kernel.org
Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
---
block/genhd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/genhd.c b/block/genhd.c
index 9bbc38d12792..bd3a6841e5b5 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -90,7 +90,7 @@ bool set_capacity_and_notify(struct gendisk *disk, sector_t size)
(disk->flags & GENHD_FL_HIDDEN))
return false;
- pr_info("%s: detected capacity change from %lld to %lld\n",
+ pr_info_ratelimited("%s: detected capacity change from %lld to %lld\n",
disk->disk_name, capacity, size);
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] block: rate-limit capacity change info log
2025-11-17 5:34 [PATCH] block: rate-limit capacity change info log Li Chen
@ 2025-11-17 16:54 ` Bart Van Assche
2025-11-17 18:24 ` Chaitanya Kulkarni
2025-11-17 18:30 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2025-11-17 16:54 UTC (permalink / raw)
To: Li Chen, Jens Axboe, linux-block, linux-kernel; +Cc: stable
On 11/16/25 9:34 PM, Li Chen wrote:
> From: Li Chen <chenl311@chinatelecom.cn>
>
> loop devices under heavy stress-ng loop streessor can trigger many
> capacity change events in a short time. Each event prints an info
> message from set_capacity_and_notify(), flooding the console and
> contributing to soft lockups on slow consoles.
>
> Switch the printk in set_capacity_and_notify() to
> pr_info_ratelimited() so frequent capacity changes do not spam
> the log while still reporting occasional changes.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
> ---
> block/genhd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/genhd.c b/block/genhd.c
> index 9bbc38d12792..bd3a6841e5b5 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -90,7 +90,7 @@ bool set_capacity_and_notify(struct gendisk *disk, sector_t size)
> (disk->flags & GENHD_FL_HIDDEN))
> return false;
>
> - pr_info("%s: detected capacity change from %lld to %lld\n",
> + pr_info_ratelimited("%s: detected capacity change from %lld to %lld\n",
> disk->disk_name, capacity, size);
>
> /*
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: rate-limit capacity change info log
2025-11-17 5:34 [PATCH] block: rate-limit capacity change info log Li Chen
2025-11-17 16:54 ` Bart Van Assche
@ 2025-11-17 18:24 ` Chaitanya Kulkarni
2025-11-17 18:30 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Chaitanya Kulkarni @ 2025-11-17 18:24 UTC (permalink / raw)
To: Li Chen, Jens Axboe, linux-block, linux-kernel; +Cc: stable
On 11/16/25 21:34, Li Chen wrote:
> From: Li Chen<chenl311@chinatelecom.cn>
>
> loop devices under heavy stress-ng loop streessor can trigger many
> capacity change events in a short time. Each event prints an info
> message from set_capacity_and_notify(), flooding the console and
> contributing to soft lockups on slow consoles.
>
> Switch the printk in set_capacity_and_notify() to
> pr_info_ratelimited() so frequent capacity changes do not spam
> the log while still reporting occasional changes.
>
> Cc:stable@vger.kernel.org
> Signed-off-by: Li Chen<chenl311@chinatelecom.cn>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: rate-limit capacity change info log
2025-11-17 5:34 [PATCH] block: rate-limit capacity change info log Li Chen
2025-11-17 16:54 ` Bart Van Assche
2025-11-17 18:24 ` Chaitanya Kulkarni
@ 2025-11-17 18:30 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2025-11-17 18:30 UTC (permalink / raw)
To: linux-block, linux-kernel, Li Chen; +Cc: stable
On Mon, 17 Nov 2025 13:34:07 +0800, Li Chen wrote:
> loop devices under heavy stress-ng loop streessor can trigger many
> capacity change events in a short time. Each event prints an info
> message from set_capacity_and_notify(), flooding the console and
> contributing to soft lockups on slow consoles.
>
> Switch the printk in set_capacity_and_notify() to
> pr_info_ratelimited() so frequent capacity changes do not spam
> the log while still reporting occasional changes.
>
> [...]
Applied, thanks!
[1/1] block: rate-limit capacity change info log
commit: 3179a5f7f86bcc3acd5d6fb2a29f891ef5615852
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-17 18:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17 5:34 [PATCH] block: rate-limit capacity change info log Li Chen
2025-11-17 16:54 ` Bart Van Assche
2025-11-17 18:24 ` Chaitanya Kulkarni
2025-11-17 18:30 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox