[EXT] Re: [PATCH v3 1/4] eal: add generic support for reading PMU events
Tomasz Duszynski
tduszynski at marvell.com
Tue Dec 13 09:05:00 CET 2022
Hello Min,
> -----Original Message-----
> From: zhoumin <zhoumin at loongson.cn>
> Sent: Wednesday, November 30, 2022 9:33 AM
> To: Tomasz Duszynski <tduszynski at marvell.com>; dev at dpdk.org
> Cc: thomas at monjalon.net; Jerin Jacob Kollanukkaran <jerinj at marvell.com>
> Subject: [EXT] Re: [PATCH v3 1/4] eal: add generic support for reading PMU events
>
> External Email
>
> ----------------------------------------------------------------------
> Hi Tomasz,
>
[...]
> > +void
> > +eal_pmu_fini(void)
> > +{
> > + struct rte_pmu_event *event, *tmp;
> > + int lcore_id;
> > +
> > + RTE_TAILQ_FOREACH_SAFE(event, &rte_pmu->event_list, next, tmp) {
> > + TAILQ_REMOVE(&rte_pmu->event_list, event, next);
> > + free(event->name);
> > + rte_free(event);
> > + }
> > +
> > + RTE_LCORE_FOREACH_WORKER(lcore_id)
> > + cleanup_events(lcore_id);
> > +
> > + pmu_arch_fini();
> > + free(rte_pmu->name);
> > + rte_free(rte_pmu);
> > +}
>
> There may be some problems with the implementation of eal_pmu_fini(), but I'm not sure.
>
> I checked some test reports for this series. It seems that the test case of `debug_autotest` in
>
> the DPDK unit test has an issue when the child process in this test case calls the function
> of rte_exit().
>
> The call chain is as follows:
>
> test_debug() -> test_exit() -> test_exit_val() -> rte_exit() ->
> rte_eal_cleanup() -> eal_pmu_fini().
>
> The issue may be related to memory free from the error message as follows:
>
> test_exit_valEAL: Error: Invalid memory
> EAL: Error - exiting with code: 1
> Cause: test_exit_valEAL: Error: Invalid memory
> EAL: Error - exiting with code: 2
> Cause: test_exit_valEAL: Error: Invalid memory
> EAL: Error - exiting with code: 255
> Cause: test_exit_valEAL: Error: Invalid memory
> EAL: Error - exiting with code: -1
> Cause: test_exit_valEAL: Error: Invalid memory
>
> The above error message will disappear when I comment out the calling to the eal_pmu_fini() in
>
> the rte_eal_cleanup().
>
Thanks for pointing this out. This was apparently happening due to freeing same hugepage memory in forked process multiple times.
More information about the dev
mailing list