* [PATCH] perf bench: Fix memory leaks.
@ 2021-11-08 4:48 Sohaib Mohamed
2021-11-08 18:57 ` Ian Rogers
0 siblings, 1 reply; 3+ messages in thread
From: Sohaib Mohamed @ 2021-11-08 4:48 UTC (permalink / raw)
Cc: sohaib.amhmd, irogers, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
Jiri Olsa, Namhyung Kim, Pierre Gondois, linux-perf-users,
linux-kernel
ASan reports memory leaks while running:
$ perf bench sched all
Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
---
tools/perf/bench/sched-messaging.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index 488f6e6ba1a5..fa0ff4ce2b74 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -223,6 +223,8 @@ static unsigned int group(pthread_t *pth,
snd_ctx->out_fds[i] = fds[1];
if (!thread_mode)
close(fds[0]);
+
+ free(ctx);
}
/* Now we have all the fds, fork the senders */
@@ -239,6 +241,8 @@ static unsigned int group(pthread_t *pth,
for (i = 0; i < num_fds; i++)
close(snd_ctx->out_fds[i]);
+ free(snd_ctx);
+
/* Return number of children to reap */
return num_fds * 2;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf bench: Fix memory leaks.
2021-11-08 4:48 [PATCH] perf bench: Fix memory leaks Sohaib Mohamed
@ 2021-11-08 18:57 ` Ian Rogers
2021-11-10 2:24 ` Sohaib Mohamed
0 siblings, 1 reply; 3+ messages in thread
From: Ian Rogers @ 2021-11-08 18:57 UTC (permalink / raw)
To: Sohaib Mohamed
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Pierre Gondois, linux-perf-users, linux-kernel
On Sun, Nov 7, 2021 at 8:49 PM Sohaib Mohamed <sohaib.amhmd@gmail.com> wrote:
>
> ASan reports memory leaks while running:
>
> $ perf bench sched all
>
> Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Acked-by: Ian Rogers <irogers@google.com>
I think you can add:
Fixes: e27454cc6352c ("perf bench: Add sched-messaging.c: Benchmark
for scheduler and IPC mechanisms based on hackbench")
This will then get the fix backported to older stable perf commands.
Thanks,
Ian
> ---
> tools/perf/bench/sched-messaging.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
> index 488f6e6ba1a5..fa0ff4ce2b74 100644
> --- a/tools/perf/bench/sched-messaging.c
> +++ b/tools/perf/bench/sched-messaging.c
> @@ -223,6 +223,8 @@ static unsigned int group(pthread_t *pth,
> snd_ctx->out_fds[i] = fds[1];
> if (!thread_mode)
> close(fds[0]);
> +
> + free(ctx);
> }
>
> /* Now we have all the fds, fork the senders */
> @@ -239,6 +241,8 @@ static unsigned int group(pthread_t *pth,
> for (i = 0; i < num_fds; i++)
> close(snd_ctx->out_fds[i]);
>
> + free(snd_ctx);
> +
> /* Return number of children to reap */
> return num_fds * 2;
> }
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf bench: Fix memory leaks.
2021-11-08 18:57 ` Ian Rogers
@ 2021-11-10 2:24 ` Sohaib Mohamed
0 siblings, 0 replies; 3+ messages in thread
From: Sohaib Mohamed @ 2021-11-10 2:24 UTC (permalink / raw)
To: Ian Rogers
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Pierre Gondois, linux-perf-users, linux-kernel
On Mon, Nov 08, 2021 at 10:57:25AM -0800, Ian Rogers wrote:
> On Sun, Nov 7, 2021 at 8:49 PM Sohaib Mohamed <sohaib.amhmd@gmail.com> wrote:
> >
> > ASan reports memory leaks while running:
> >
> > $ perf bench sched all
> >
> > Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
>
> Acked-by: Ian Rogers <irogers@google.com>
>
> I think you can add:
> Fixes: e27454cc6352c ("perf bench: Add sched-messaging.c: Benchmark
> for scheduler and IPC mechanisms based on hackbench")
>
> This will then get the fix backported to older stable perf commands.
I just added these two lines to version 2:
https://lore.kernel.org/linux-perf-users/20211110022012.16620-1-sohaib.amhmd@gmail.com/
Thanks,
Sohaib
>
> Thanks,
> Ian
>
> > ---
> > tools/perf/bench/sched-messaging.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
> > index 488f6e6ba1a5..fa0ff4ce2b74 100644
> > --- a/tools/perf/bench/sched-messaging.c
> > +++ b/tools/perf/bench/sched-messaging.c
> > @@ -223,6 +223,8 @@ static unsigned int group(pthread_t *pth,
> > snd_ctx->out_fds[i] = fds[1];
> > if (!thread_mode)
> > close(fds[0]);
> > +
> > + free(ctx);
> > }
> >
> > /* Now we have all the fds, fork the senders */
> > @@ -239,6 +241,8 @@ static unsigned int group(pthread_t *pth,
> > for (i = 0; i < num_fds; i++)
> > close(snd_ctx->out_fds[i]);
> >
> > + free(snd_ctx);
> > +
> > /* Return number of children to reap */
> > return num_fds * 2;
> > }
> > --
> > 2.25.1
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-10 2:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 4:48 [PATCH] perf bench: Fix memory leaks Sohaib Mohamed
2021-11-08 18:57 ` Ian Rogers
2021-11-10 2:24 ` Sohaib Mohamed
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.