* [LTP] perf_event_open03.c:95: TFAIL: Likely kernel memory leak detected
@ 2024-07-01 11:37 Li Wang
2024-07-01 12:10 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Li Wang @ 2024-07-01 11:37 UTC (permalink / raw)
To: Martin Doucha; +Cc: LTP List
Hi Martin, All,
Our automatic jobs keep throwing thus false positives on the daily test.
After checking perf_event_open03.c, it uses the diff of MemAvailable as the
final condition for memory leaks.
perf_event_open03.c:95: TFAIL: Likely kernel memory leak detected
I think relying solely on the MemAvailable metric to detect a memory leak
can be imprecise, because available memory can be influenced by various
factors unrelated to the specific code being tested.
And "/sys/kernel/debug/kmemleak" maybe a good tool for diagnosing memory
leak,
but it is usually disabled on the stock kernel by default, so far I have no
better idea
how to improve that, any suggestions?
diff = SAFE_READ_MEMINFO("MemAvailable:");
/* leak about 100MB of RAM */
for (i = 0; i < iterations; i++) {
ioctl(fd, PERF_EVENT_IOC_SET_FILTER, "filter,0/0@abcd");
check_progress(i);
}
diff -= SAFE_READ_MEMINFO("MemAvailable:");
if (diff > 50 * 1024)
tst_res(TFAIL, "Likely kernel memory leak detected");
...
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [LTP] perf_event_open03.c:95: TFAIL: Likely kernel memory leak detected
2024-07-01 11:37 [LTP] perf_event_open03.c:95: TFAIL: Likely kernel memory leak detected Li Wang
@ 2024-07-01 12:10 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2024-07-01 12:10 UTC (permalink / raw)
To: Li Wang; +Cc: LTP List
Hi!
> Our automatic jobs keep throwing thus false positives on the daily test.
> After checking perf_event_open03.c, it uses the diff of MemAvailable as the
> final condition for memory leaks.
>
> perf_event_open03.c:95: TFAIL: Likely kernel memory leak detected
>
> I think relying solely on the MemAvailable metric to detect a memory leak
> can be imprecise, because available memory can be influenced by various
> factors unrelated to the specific code being tested.
>
> And "/sys/kernel/debug/kmemleak" maybe a good tool for diagnosing memory
> leak,
> but it is usually disabled on the stock kernel by default, so far I have no
> better idea
> how to improve that, any suggestions?
>
>
> diff = SAFE_READ_MEMINFO("MemAvailable:");
>
> /* leak about 100MB of RAM */
> for (i = 0; i < iterations; i++) {
> ioctl(fd, PERF_EVENT_IOC_SET_FILTER, "filter,0/0@abcd");
> check_progress(i);
> }
>
> diff -= SAFE_READ_MEMINFO("MemAvailable:");
>
> if (diff > 50 * 1024)
> tst_res(TFAIL, "Likely kernel memory leak detected");
> ...
Hmm, maybe we can sample the MemAvailable a few times, e.g. every 20MB
leaked and fail the test if we found that most samples have increased
the value.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-01 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 11:37 [LTP] perf_event_open03.c:95: TFAIL: Likely kernel memory leak detected Li Wang
2024-07-01 12:10 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox