eal: cleanup alarm and multiprocess hotplug before memory detach
Checks
Commit Message
Alarm and multiprocess hotplug still need access hugepage memory,
if alarm event processed after memory detach, it may cause SEGV.
So cleanup alarm and multiprocess hotplug before memory detach.
Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
---
lib/eal/linux/eal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Thomas Monjalon <thomas@monjalon.net> 于2022年12月13日周二 16:34写道:
>
> 13/12/2022 08:59, Fengnan Chang:
> > Alarm and multiprocess hotplug still need access hugepage memory,
> > if alarm event processed after memory detach, it may cause SEGV.
> > So cleanup alarm and multiprocess hotplug before memory detach.
> >
> > Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
> > ---
> > lib/eal/linux/eal.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> What about FreeBSD?
>
FreeBSD may have same problem, I'll add FreeBSD in V2, before that I
want wait a few days for more comments.
Thanks.
@@ -1372,11 +1372,11 @@ rte_eal_cleanup(void)
eal_bus_cleanup();
rte_trace_save();
eal_trace_fini();
+ eal_mp_dev_hotplug_cleanup();
+ rte_eal_alarm_cleanup();
/* after this point, any DPDK pointers will become dangling */
rte_eal_memory_detach();
- eal_mp_dev_hotplug_cleanup();
rte_eal_malloc_heap_cleanup();
- rte_eal_alarm_cleanup();
eal_cleanup_config(internal_conf);
rte_eal_log_cleanup();
return 0;