All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach
@ 2022-12-13  7:59 Fengnan Chang
  2022-12-13  8:34 ` Thomas Monjalon
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Fengnan Chang @ 2022-12-13  7:59 UTC (permalink / raw)
  To: dev; +Cc: thomas, david.marchand, 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(-)

diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 8c118d0d9f..c76f026023 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -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;
-- 
2.37.0 (Apple Git-136)


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

* Re: [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach
  2022-12-13  7:59 [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach Fengnan Chang
@ 2022-12-13  8:34 ` Thomas Monjalon
  2022-12-13  8:54   ` [External] " Fengnan Chang
  2023-02-09 12:03 ` [PATCH v2] " Fengnan Chang
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2022-12-13  8:34 UTC (permalink / raw)
  To: Fengnan Chang; +Cc: dev, david.marchand

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?




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

* Re: [External] Re: [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach
  2022-12-13  8:34 ` Thomas Monjalon
@ 2022-12-13  8:54   ` Fengnan Chang
  2022-12-13  8:58     ` David Marchand
  0 siblings, 1 reply; 7+ messages in thread
From: Fengnan Chang @ 2022-12-13  8:54 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, david.marchand

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.

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

* Re: [External] Re: [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach
  2022-12-13  8:54   ` [External] " Fengnan Chang
@ 2022-12-13  8:58     ` David Marchand
  0 siblings, 0 replies; 7+ messages in thread
From: David Marchand @ 2022-12-13  8:58 UTC (permalink / raw)
  To: Fengnan Chang; +Cc: Thomas Monjalon, dev

On Tue, Dec 13, 2022 at 9:54 AM Fengnan Chang
<changfengnan@bytedance.com> wrote:
>
> 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.

This fix is backport material, please add a Fixes: line.
Thanks.


-- 
David Marchand


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

* [PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach
  2022-12-13  7:59 [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach Fengnan Chang
  2022-12-13  8:34 ` Thomas Monjalon
@ 2023-02-09 12:03 ` Fengnan Chang
  2023-02-09 12:09 ` Fengnan Chang
  2023-02-09 12:45 ` Fengnan Chang
  3 siblings, 0 replies; 7+ messages in thread
From: Fengnan Chang @ 2023-02-09 12:03 UTC (permalink / raw)
  To: thomas, david.marchand; +Cc: dev, 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.

Fixes: 90b13ab8d4f7 ("alarm: remove direct access to interrupt handle")
Fixes: a0cc7be20dd1 ("mem: cleanup multiprocess resources")

Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
---
 lib/eal/freebsd/eal.c | 2 +-
 lib/eal/linux/eal.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 1b58cd3da6..83b99c601f 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -897,9 +897,9 @@ rte_eal_cleanup(void)
 	eal_bus_cleanup();
 	rte_trace_save();
 	eal_trace_fini();
+	rte_eal_alarm_cleanup();
 	/* after this point, any DPDK pointers will become dangling */
 	rte_eal_memory_detach();
-	rte_eal_alarm_cleanup();
 	eal_cleanup_config(internal_conf);
 	return 0;
 }
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 8c118d0d9f..c76f026023 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -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;
-- 
2.37.0 (Apple Git-136)


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

* [PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach
  2022-12-13  7:59 [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach Fengnan Chang
  2022-12-13  8:34 ` Thomas Monjalon
  2023-02-09 12:03 ` [PATCH v2] " Fengnan Chang
@ 2023-02-09 12:09 ` Fengnan Chang
  2023-02-09 12:45 ` Fengnan Chang
  3 siblings, 0 replies; 7+ messages in thread
From: Fengnan Chang @ 2023-02-09 12:09 UTC (permalink / raw)
  To: thomas, david.marchand; +Cc: dev, 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.

Fixes: 90b13ab8d4f7 ("alarm: remove direct access to interrupt handle")
Fixes: a0cc7be20dd1 ("mem: cleanup multiprocess resources")

Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
---
 lib/eal/freebsd/eal.c | 2 +-
 lib/eal/linux/eal.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 1b58cd3da6..83b99c601f 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -897,9 +897,9 @@ rte_eal_cleanup(void)
 	eal_bus_cleanup();
 	rte_trace_save();
 	eal_trace_fini();
+	rte_eal_alarm_cleanup();
 	/* after this point, any DPDK pointers will become dangling */
 	rte_eal_memory_detach();
-	rte_eal_alarm_cleanup();
 	eal_cleanup_config(internal_conf);
 	return 0;
 }
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 8c118d0d9f..c76f026023 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -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;
-- 
2.37.0 (Apple Git-136)


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

* [PATCH v2] eal: cleanup alarm and multiprocess hotplug before memory detach
  2022-12-13  7:59 [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach Fengnan Chang
                   ` (2 preceding siblings ...)
  2023-02-09 12:09 ` Fengnan Chang
@ 2023-02-09 12:45 ` Fengnan Chang
  3 siblings, 0 replies; 7+ messages in thread
From: Fengnan Chang @ 2023-02-09 12:45 UTC (permalink / raw)
  To: thomas, david.marchand; +Cc: dev, 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.

Fixes: 90b13ab8d4f7 ("alarm: remove direct access to interrupt handle")
Fixes: a0cc7be20dd1 ("mem: cleanup multiprocess resources")

Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
---
 lib/eal/freebsd/eal.c | 2 +-
 lib/eal/linux/eal.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 1b58cd3da6..83b99c601f 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -897,9 +897,9 @@ rte_eal_cleanup(void)
 	eal_bus_cleanup();
 	rte_trace_save();
 	eal_trace_fini();
+	rte_eal_alarm_cleanup();
 	/* after this point, any DPDK pointers will become dangling */
 	rte_eal_memory_detach();
-	rte_eal_alarm_cleanup();
 	eal_cleanup_config(internal_conf);
 	return 0;
 }
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 8c118d0d9f..c76f026023 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -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;
-- 
2.37.0 (Apple Git-136)


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

end of thread, other threads:[~2023-02-13 14:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13  7:59 [PATCH] eal: cleanup alarm and multiprocess hotplug before memory detach Fengnan Chang
2022-12-13  8:34 ` Thomas Monjalon
2022-12-13  8:54   ` [External] " Fengnan Chang
2022-12-13  8:58     ` David Marchand
2023-02-09 12:03 ` [PATCH v2] " Fengnan Chang
2023-02-09 12:09 ` Fengnan Chang
2023-02-09 12:45 ` Fengnan Chang

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.