All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: fix leak of block histogram data
@ 2026-10-12 11:43 Daniel P. Berrangé
  2026-10-13 18:58 ` Eric Blake
  2026-10-30 11:28 ` Kevin Wolf
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2026-10-12 11:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, qemu-block, Hanna Reitz, Daniel P. Berrangé

The block_acct_cleanup method failed to release memory associated
with block histograms.

Fixes: b741ae7417 (block/accounting: introduce latency histogram)
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 block/accounting.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/block/accounting.c b/block/accounting.c
index 038af370170..40ed70782b4 100644
--- a/block/accounting.c
+++ b/block/accounting.c
@@ -80,6 +80,13 @@ bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
 void block_acct_cleanup(BlockAcctStats *stats)
 {
     BlockAcctTimedStats *s, *next;
+    size_t i;
+    for (i = 0; i < BLOCK_MAX_IOTYPE; i++) {
+        BlockLatencyHistogram *hist = &stats->latency_histogram[i];
+        g_free(hist->bins);
+        g_free(hist->boundaries);
+    }
+
     QSLIST_FOREACH_SAFE(s, &stats->intervals, entries, next) {
         g_free(s);
     }
-- 
2.56.0



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

* Re: [PATCH] block: fix leak of block histogram data
  2026-10-12 11:43 [PATCH] block: fix leak of block histogram data Daniel P. Berrangé
@ 2026-10-13 18:58 ` Eric Blake
  2026-10-30 11:28 ` Kevin Wolf
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2026-10-13 18:58 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: qemu-devel, Kevin Wolf, qemu-block, Hanna Reitz

On Mon, Oct 12, 2026 at 12:43:59PM +0100, Daniel P. Berrangé wrote:
> The block_acct_cleanup method failed to release memory associated
> with block histograms.
> 
> Fixes: b741ae7417 (block/accounting: introduce latency histogram)
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  block/accounting.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/block/accounting.c b/block/accounting.c
> index 038af370170..40ed70782b4 100644
> --- a/block/accounting.c
> +++ b/block/accounting.c
> @@ -80,6 +80,13 @@ bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
>  void block_acct_cleanup(BlockAcctStats *stats)
>  {
>      BlockAcctTimedStats *s, *next;
> +    size_t i;
> +    for (i = 0; i < BLOCK_MAX_IOTYPE; i++) {
> +        BlockLatencyHistogram *hist = &stats->latency_histogram[i];
> +        g_free(hist->bins);
> +        g_free(hist->boundaries);
> +    }
> +
>      QSLIST_FOREACH_SAFE(s, &stats->intervals, entries, next) {
>          g_free(s);
>      }
> -- 
> 2.56.0
> 
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



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

* Re: [PATCH] block: fix leak of block histogram data
  2026-10-12 11:43 [PATCH] block: fix leak of block histogram data Daniel P. Berrangé
  2026-10-13 18:58 ` Eric Blake
@ 2026-10-30 11:28 ` Kevin Wolf
  2026-10-30 11:34   ` Daniel P. Berrangé
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Wolf @ 2026-10-30 11:28 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: qemu-devel, qemu-block, Hanna Reitz

Am 12.10.2026 um 13:43 hat Daniel P. Berrangé geschrieben:
> The block_acct_cleanup method failed to release memory associated
> with block histograms.
> 
> Fixes: b741ae7417 (block/accounting: introduce latency histogram)
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  block/accounting.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/block/accounting.c b/block/accounting.c
> index 038af370170..40ed70782b4 100644
> --- a/block/accounting.c
> +++ b/block/accounting.c
> @@ -80,6 +80,13 @@ bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
>  void block_acct_cleanup(BlockAcctStats *stats)
>  {
>      BlockAcctTimedStats *s, *next;
> +    size_t i;
> +    for (i = 0; i < BLOCK_MAX_IOTYPE; i++) {
> +        BlockLatencyHistogram *hist = &stats->latency_histogram[i];
> +        g_free(hist->bins);
> +        g_free(hist->boundaries);
> +    }
> +

This seems to duplicate block_latency_histograms_clear(). Should we just
call it here?

Kevin



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

* Re: [PATCH] block: fix leak of block histogram data
  2026-10-30 11:28 ` Kevin Wolf
@ 2026-10-30 11:34   ` Daniel P. Berrangé
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrangé @ 2026-10-30 11:34 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, qemu-block, Hanna Reitz

On Fri, Oct 30, 2026 at 12:28:18PM +0100, Kevin Wolf wrote:
> Am 12.10.2026 um 13:43 hat Daniel P. Berrangé geschrieben:
> > The block_acct_cleanup method failed to release memory associated
> > with block histograms.
> > 
> > Fixes: b741ae7417 (block/accounting: introduce latency histogram)
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >  block/accounting.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/block/accounting.c b/block/accounting.c
> > index 038af370170..40ed70782b4 100644
> > --- a/block/accounting.c
> > +++ b/block/accounting.c
> > @@ -80,6 +80,13 @@ bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
> >  void block_acct_cleanup(BlockAcctStats *stats)
> >  {
> >      BlockAcctTimedStats *s, *next;
> > +    size_t i;
> > +    for (i = 0; i < BLOCK_MAX_IOTYPE; i++) {
> > +        BlockLatencyHistogram *hist = &stats->latency_histogram[i];
> > +        g_free(hist->bins);
> > +        g_free(hist->boundaries);
> > +    }
> > +
> 
> This seems to duplicate block_latency_histograms_clear(). Should we just
> call it here?

Yes, that sounds sensible, I'll repost.

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



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

end of thread, other threads:[~2026-10-30 11:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 11:43 [PATCH] block: fix leak of block histogram data Daniel P. Berrangé
2026-10-13 18:58 ` Eric Blake
2026-10-30 11:28 ` Kevin Wolf
2026-10-30 11:34   ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.