* [PATCH] fuse: limit debug log output during ring teardown
@ 2025-11-29 11:06 Long Li
2025-12-02 17:40 ` Bernd Schubert
0 siblings, 1 reply; 3+ messages in thread
From: Long Li @ 2025-11-29 11:06 UTC (permalink / raw)
To: miklos; +Cc: linux-fsdevel, bschubert, leo.lilong, yangerkun, lonuxli.64
Currently, if there are pending entries in the queue after the teardown
timeout, the system keeps printing entry state information at very short
intervals (FUSE_URING_TEARDOWN_INTERVAL). This can flood the system logs.
Additionally, ring->stop_debug_log is set but not used.
Use ring->stop_debug_log as a control flag to only print entry state
information once after teardown timeout, preventing excessive debug
output. Also add a final message when all queues have stopped.
Signed-off-by: Long Li <leo.lilong@huawei.com>
---
fs/fuse/dev_uring.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
index 5ceb217ced1b..d71ccdf78887 100644
--- a/fs/fuse/dev_uring.c
+++ b/fs/fuse/dev_uring.c
@@ -453,13 +453,15 @@ static void fuse_uring_async_stop_queues(struct work_struct *work)
* If there are still queue references left
*/
if (atomic_read(&ring->queue_refs) > 0) {
- if (time_after(jiffies,
+ if (!ring->stop_debug_log && time_after(jiffies,
ring->teardown_time + FUSE_URING_TEARDOWN_TIMEOUT))
fuse_uring_log_ent_state(ring);
schedule_delayed_work(&ring->async_teardown_work,
FUSE_URING_TEARDOWN_INTERVAL);
} else {
+ if (ring->stop_debug_log)
+ pr_info("All queues in the ring=%p have stopped\n", ring);
wake_up_all(&ring->stop_waitq);
}
}
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: limit debug log output during ring teardown
2025-11-29 11:06 [PATCH] fuse: limit debug log output during ring teardown Long Li
@ 2025-12-02 17:40 ` Bernd Schubert
2025-12-03 1:31 ` Long Li
0 siblings, 1 reply; 3+ messages in thread
From: Bernd Schubert @ 2025-12-02 17:40 UTC (permalink / raw)
To: Long Li, miklos; +Cc: linux-fsdevel, bschubert, yangerkun, lonuxli.64
Hi Long,
On 11/29/25 12:06, Long Li wrote:
> Currently, if there are pending entries in the queue after the teardown
> timeout, the system keeps printing entry state information at very short
> intervals (FUSE_URING_TEARDOWN_INTERVAL). This can flood the system logs.
> Additionally, ring->stop_debug_log is set but not used.
>
> Use ring->stop_debug_log as a control flag to only print entry state
> information once after teardown timeout, preventing excessive debug
> output. Also add a final message when all queues have stopped.
>
> Signed-off-by: Long Li <leo.lilong@huawei.com>
> ---
> fs/fuse/dev_uring.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
> index 5ceb217ced1b..d71ccdf78887 100644
> --- a/fs/fuse/dev_uring.c
> +++ b/fs/fuse/dev_uring.c
> @@ -453,13 +453,15 @@ static void fuse_uring_async_stop_queues(struct work_struct *work)
> * If there are still queue references left
> */
> if (atomic_read(&ring->queue_refs) > 0) {
> - if (time_after(jiffies,
> + if (!ring->stop_debug_log && time_after(jiffies,
> ring->teardown_time + FUSE_URING_TEARDOWN_TIMEOUT))
> fuse_uring_log_ent_state(ring);
>
> schedule_delayed_work(&ring->async_teardown_work,
> FUSE_URING_TEARDOWN_INTERVAL);
> } else {
> + if (ring->stop_debug_log)
> + pr_info("All queues in the ring=%p have stopped\n", ring);
> wake_up_all(&ring->stop_waitq);
> }
> }
how about like this?
diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
index f6b12aebb8bb..a527e58b404a 100644
--- a/fs/fuse/dev_uring.c
+++ b/fs/fuse/dev_uring.c
@@ -452,9 +452,11 @@ static void fuse_uring_async_stop_queues(struct work_struct *work)
* If there are still queue references left
*/
if (atomic_read(&ring->queue_refs) > 0) {
- if (time_after(jiffies,
- ring->teardown_time + FUSE_URING_TEARDOWN_TIMEOUT))
+ if (time_after(jiffies, ring->teardown_time +
+ FUSE_URING_TEARDOWN_TIMEOUT)) {
fuse_uring_log_ent_state(ring);
+ ring->teardown_time = jiffies;
+ }
schedule_delayed_work(&ring->async_teardown_work,
FUSE_URING_TEARDOWN_INTERVAL);
Most of it is formatting, it just updates "ring->teardown_time = jiffies",
idea is that is logs the remaining entries. If you run into it there is
probably a bug - io-uring will also start to spill warnings.
Thanks,
Bernd
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: limit debug log output during ring teardown
2025-12-02 17:40 ` Bernd Schubert
@ 2025-12-03 1:31 ` Long Li
0 siblings, 0 replies; 3+ messages in thread
From: Long Li @ 2025-12-03 1:31 UTC (permalink / raw)
To: Bernd Schubert, miklos; +Cc: linux-fsdevel, bschubert, yangerkun, lonuxli.64
On Tue, Dec 02, 2025 at 06:40:10PM +0100, Bernd Schubert wrote:
> Hi Long,
>
> On 11/29/25 12:06, Long Li wrote:
> > Currently, if there are pending entries in the queue after the teardown
> > timeout, the system keeps printing entry state information at very short
> > intervals (FUSE_URING_TEARDOWN_INTERVAL). This can flood the system logs.
> > Additionally, ring->stop_debug_log is set but not used.
> >
> > Use ring->stop_debug_log as a control flag to only print entry state
> > information once after teardown timeout, preventing excessive debug
> > output. Also add a final message when all queues have stopped.
> >
> > Signed-off-by: Long Li <leo.lilong@huawei.com>
> > ---
> > fs/fuse/dev_uring.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
> > index 5ceb217ced1b..d71ccdf78887 100644
> > --- a/fs/fuse/dev_uring.c
> > +++ b/fs/fuse/dev_uring.c
> > @@ -453,13 +453,15 @@ static void fuse_uring_async_stop_queues(struct work_struct *work)
> > * If there are still queue references left
> > */
> > if (atomic_read(&ring->queue_refs) > 0) {
> > - if (time_after(jiffies,
> > + if (!ring->stop_debug_log && time_after(jiffies,
> > ring->teardown_time + FUSE_URING_TEARDOWN_TIMEOUT))
> > fuse_uring_log_ent_state(ring);
> >
> > schedule_delayed_work(&ring->async_teardown_work,
> > FUSE_URING_TEARDOWN_INTERVAL);
> > } else {
> > + if (ring->stop_debug_log)
> > + pr_info("All queues in the ring=%p have stopped\n", ring);
> > wake_up_all(&ring->stop_waitq);
> > }
> > }
>
>
> how about like this?
>
> diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
> index f6b12aebb8bb..a527e58b404a 100644
> --- a/fs/fuse/dev_uring.c
> +++ b/fs/fuse/dev_uring.c
> @@ -452,9 +452,11 @@ static void fuse_uring_async_stop_queues(struct work_struct *work)
> * If there are still queue references left
> */
> if (atomic_read(&ring->queue_refs) > 0) {
> - if (time_after(jiffies,
> - ring->teardown_time + FUSE_URING_TEARDOWN_TIMEOUT))
> + if (time_after(jiffies, ring->teardown_time +
> + FUSE_URING_TEARDOWN_TIMEOUT)) {
> fuse_uring_log_ent_state(ring);
> + ring->teardown_time = jiffies;
> + }
>
> schedule_delayed_work(&ring->async_teardown_work,
> FUSE_URING_TEARDOWN_INTERVAL);
>
> Most of it is formatting, it just updates "ring->teardown_time = jiffies",
> idea is that is logs the remaining entries. If you run into it there is
> probably a bug - io-uring will also start to spill warnings.
>
>
> Thanks,
> Bernd
>
Hi, Bernd
Thanks for your reply, if we want to continuously log entries that have
not been stopped, the change to update teardown_time looks good to me,
and ring->stop_debug_log can be deleted if it is not used.
Long Li
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-03 1:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-29 11:06 [PATCH] fuse: limit debug log output during ring teardown Long Li
2025-12-02 17:40 ` Bernd Schubert
2025-12-03 1:31 ` Long Li
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).