From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Anatoly Burakov <anatoly.burakov@intel.com>,
Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
Dmitry Malloy <dmitrym@microsoft.com>,
Pallavi Kadam <pallavi.kadam@intel.com>
Subject: [PATCH v6 5/5] eal: malloc: cleanup mp resources
Date: Sat, 13 Nov 2021 09:22:57 -0800 [thread overview]
Message-ID: <20211113172257.6543-6-stephen@networkplumber.org> (raw)
In-Reply-To: <20211113172257.6543-1-stephen@networkplumber.org>
The mp action resources in malloc should be cleaned up via
rte_eal_cleanup.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
lib/eal/common/malloc_heap.c | 6 ++++++
lib/eal/common/malloc_heap.h | 3 +++
lib/eal/common/malloc_mp.c | 12 ++++++++++++
lib/eal/common/malloc_mp.h | 3 +++
lib/eal/linux/eal.c | 1 +
lib/eal/windows/eal_mp.c | 7 +++++++
6 files changed, 32 insertions(+)
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index 55aad2711b39..666f770fbf6d 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -1403,3 +1403,9 @@ rte_eal_malloc_heap_init(void)
/* add all IOVA-contiguous areas to the heap */
return rte_memseg_contig_walk(malloc_add_seg, NULL);
}
+
+void
+rte_eal_malloc_heap_cleanup(void)
+{
+ unregister_mp_requests();
+}
diff --git a/lib/eal/common/malloc_heap.h b/lib/eal/common/malloc_heap.h
index 3a29d024b4ca..3b2fbc0aa059 100644
--- a/lib/eal/common/malloc_heap.h
+++ b/lib/eal/common/malloc_heap.h
@@ -85,4 +85,7 @@ malloc_socket_to_heap_id(unsigned int socket_id);
int
rte_eal_malloc_heap_init(void);
+void
+rte_eal_malloc_heap_cleanup(void);
+
#endif /* MALLOC_HEAP_H_ */
diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
index 2e597a17a2f2..5f6f275b7859 100644
--- a/lib/eal/common/malloc_mp.c
+++ b/lib/eal/common/malloc_mp.c
@@ -806,3 +806,15 @@ register_mp_requests(void)
}
return 0;
}
+
+void
+unregister_mp_requests(void)
+{
+ if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+ rte_mp_action_unregister(MP_ACTION_REQUEST);
+ } else {
+ rte_mp_action_unregister(MP_ACTION_SYNC);
+ rte_mp_action_unregister(MP_ACTION_ROLLBACK);
+ rte_mp_action_unregister(MP_ACTION_RESPONSE);
+ }
+}
diff --git a/lib/eal/common/malloc_mp.h b/lib/eal/common/malloc_mp.h
index 0095062b72f2..c806f7beafe0 100644
--- a/lib/eal/common/malloc_mp.h
+++ b/lib/eal/common/malloc_mp.h
@@ -63,6 +63,9 @@ struct malloc_mp_req {
int
register_mp_requests(void);
+void
+unregister_mp_requests(void);
+
int
request_to_primary(struct malloc_mp_req *req);
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 1a13a3474e38..ea663fe02b93 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1371,6 +1371,7 @@ rte_eal_cleanup(void)
/* 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();
rte_trace_save();
eal_trace_fini();
diff --git a/lib/eal/windows/eal_mp.c b/lib/eal/windows/eal_mp.c
index f2fa9366f668..76413f49a393 100644
--- a/lib/eal/windows/eal_mp.c
+++ b/lib/eal/windows/eal_mp.c
@@ -87,6 +87,13 @@ register_mp_requests(void)
return 0;
}
+void
+unregister_mp_requests(void)
+{
+ /* Non-stub function succeeds if multi-process is not supported. */
+ EAL_LOG_STUB();
+}
+
int
request_to_primary(struct malloc_mp_req *req)
{
--
2.30.2
next prev parent reply other threads:[~2021-11-13 17:23 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-04 1:33 [dpdk-dev] [PATCH 00/14] cleanup resources on shutdown Stephen Hemminger
2020-01-04 1:33 ` [dpdk-dev] [PATCH 01/14] eal: log: close on cleanup Stephen Hemminger
2020-01-04 1:33 ` [dpdk-dev] [PATCH 02/14] eal: log: free dynamic state " Stephen Hemminger
2020-04-25 16:26 ` David Marchand
2020-01-04 1:33 ` [dpdk-dev] [PATCH 03/14] eal: alarm: close timerfd on eal cleanup Stephen Hemminger
2020-04-25 16:32 ` David Marchand
2020-01-04 1:33 ` [dpdk-dev] [PATCH 04/14] eal: cleanup threads Stephen Hemminger
2020-02-04 14:48 ` Aaron Conole
2020-01-04 1:33 ` [dpdk-dev] [PATCH 05/14] eal: intr: cleanup resources Stephen Hemminger
2020-04-25 16:49 ` David Marchand
2020-04-26 16:24 ` Stephen Hemminger
2020-01-04 1:33 ` [dpdk-dev] [PATCH 06/14] eal: mp: end the multiprocess thread during cleanup Stephen Hemminger
2020-04-27 15:37 ` Burakov, Anatoly
2020-01-04 1:33 ` [dpdk-dev] [PATCH 07/14] eal: interrupts close epoll fd on shutdown Stephen Hemminger
2020-01-04 1:33 ` [dpdk-dev] [PATCH 08/14] eal: vfio: cleanup the mp sync handle Stephen Hemminger
2020-04-27 12:12 ` Burakov, Anatoly
2020-01-04 1:33 ` [dpdk-dev] [PATCH 09/14] eal: close mem config on cleanup Stephen Hemminger
2020-04-27 12:12 ` Burakov, Anatoly
2020-04-27 17:00 ` Stephen Hemminger
2020-04-28 9:20 ` Burakov, Anatoly
2020-01-04 1:33 ` [dpdk-dev] [PATCH 10/14] tap: close netlink socket on device close Stephen Hemminger
2020-04-25 15:52 ` David Marchand
2020-01-04 1:33 ` [dpdk-dev] [PATCH 11/14] eal: cleanup plugins data Stephen Hemminger
2020-01-04 1:33 ` [dpdk-dev] [PATCH 12/14] ethdev: raise priority of old driver warning Stephen Hemminger
2020-04-25 15:53 ` Thomas Monjalon
2020-01-04 1:33 ` [dpdk-dev] [PATCH 13/14] eal: hotplug: cleanup multiprocess resources Stephen Hemminger
2020-01-04 1:33 ` [dpdk-dev] [PATCH 14/14] eal: malloc: cleanup mp resources Stephen Hemminger
2020-04-27 12:10 ` Burakov, Anatoly
2020-02-05 9:32 ` [dpdk-dev] [PATCH 00/14] cleanup resources on shutdown David Marchand
2020-02-05 12:07 ` Stephen Hemminger
2020-02-05 12:32 ` David Marchand
2020-02-06 14:06 ` David Marchand
2020-02-07 18:24 ` Stephen Hemminger
2020-04-25 19:34 ` David Marchand
2020-04-28 23:14 ` [dpdk-dev] [PATCH v2 0/9] eal: " Stephen Hemminger
2020-04-28 23:14 ` [dpdk-dev] [PATCH v2 1/8] eal: log: close on cleanup Stephen Hemminger
2020-04-28 23:14 ` [dpdk-dev] [PATCH v2 2/8] eal: log: free dynamic state " Stephen Hemminger
2020-04-28 23:14 ` [dpdk-dev] [PATCH v2 3/8] eal: alarm: close file " Stephen Hemminger
2020-04-28 23:14 ` [dpdk-dev] [PATCH v2 4/8] eal: cleanup threads Stephen Hemminger
2020-04-28 23:14 ` [dpdk-dev] [PATCH v2 5/8] eal: mp: end the multiprocess thread during cleanup Stephen Hemminger
2020-04-28 23:14 ` [dpdk-dev] [PATCH v2 6/8] eal: vfio: cleanup the mp sync handle Stephen Hemminger
2020-04-28 23:14 ` [dpdk-dev] [PATCH v2 7/8] eal: hotplug: cleanup multiprocess resources Stephen Hemminger
2020-04-28 23:14 ` [dpdk-dev] [PATCH v2 8/8] eal: malloc: cleanup mp resources Stephen Hemminger
2020-04-28 23:58 ` [dpdk-dev] [PATCH v3 0/8] eal: cleanup resources on shutdown Stephen Hemminger
2020-04-28 23:58 ` [dpdk-dev] [PATCH v3 1/8] eal: log: close on cleanup Stephen Hemminger
2020-04-28 23:58 ` [dpdk-dev] [PATCH v3 2/8] eal: log: free dynamic state " Stephen Hemminger
2020-04-28 23:58 ` [dpdk-dev] [PATCH v3 3/8] eal: alarm: close file " Stephen Hemminger
2020-04-28 23:58 ` [dpdk-dev] [PATCH v3 4/8] eal: cleanup threads Stephen Hemminger
2020-04-28 23:58 ` [dpdk-dev] [PATCH v3 5/8] eal: mp: end the multiprocess thread during cleanup Stephen Hemminger
2020-04-28 23:58 ` [dpdk-dev] [PATCH v3 6/8] eal: vfio: cleanup the mp sync handle Stephen Hemminger
2020-04-28 23:58 ` [dpdk-dev] [PATCH v3 7/8] eal: hotplug: cleanup multiprocess resources Stephen Hemminger
2020-04-28 23:58 ` [dpdk-dev] [PATCH v3 8/8] eal: malloc: cleanup mp resources Stephen Hemminger
2020-05-03 17:21 ` [dpdk-dev] [PATCH v3 0/8] eal: cleanup resources on shutdown David Marchand
2020-10-19 22:24 ` Thomas Monjalon
2021-03-24 21:30 ` Thomas Monjalon
2021-11-13 0:28 ` [PATCH v4 0/5] cleanup more stuff " Stephen Hemminger
2021-11-13 0:28 ` [PATCH v4 1/5] eal: close log in eal_cleanup Stephen Hemminger
2021-11-13 0:28 ` [PATCH v4 2/5] eal: mp: end the multiprocess thread during cleanup Stephen Hemminger
2021-11-13 0:28 ` [PATCH v4 3/5] eal: vfio: cleanup the mp sync handle Stephen Hemminger
2021-11-13 0:28 ` [PATCH v4 4/5] eal: hotplug: cleanup multiprocess resources Stephen Hemminger
2021-11-13 0:28 ` [PATCH v4 5/5] eal: malloc: cleanup mp resources Stephen Hemminger
2021-11-13 3:32 ` [PATCH v5 0/5] cleanup DPDK resources via eal_cleanup Stephen Hemminger
2021-11-13 3:32 ` [PATCH v5 1/5] eal: close log in eal_cleanup Stephen Hemminger
2021-11-13 3:32 ` [PATCH v5 2/5] eal: mp: end the multiprocess thread during cleanup Stephen Hemminger
2021-11-13 3:32 ` [PATCH v5 3/5] eal: vfio: cleanup the mp sync handle Stephen Hemminger
2021-11-13 3:32 ` [PATCH v5 4/5] eal: hotplug: cleanup multiprocess resources Stephen Hemminger
2021-11-13 3:32 ` [PATCH v5 5/5] eal: malloc: cleanup mp resources Stephen Hemminger
2021-11-13 17:22 ` [PATCH v6 0/5] cleanup more resources on eal_cleanup Stephen Hemminger
2021-11-13 17:22 ` [PATCH v6 1/5] eal: close log in eal_cleanup Stephen Hemminger
2021-11-13 17:22 ` [PATCH v6 2/5] eal: mp: end the multiprocess thread during cleanup Stephen Hemminger
2021-11-13 17:22 ` [PATCH v6 3/5] eal: vfio: cleanup the mp sync handle Stephen Hemminger
2021-11-13 17:22 ` [PATCH v6 4/5] eal: hotplug: cleanup multiprocess resources Stephen Hemminger
2021-11-13 17:22 ` Stephen Hemminger [this message]
2022-02-11 20:17 ` [PATCH v6 0/5] cleanup more resources on eal_cleanup Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211113172257.6543-6-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=dmitrym@microsoft.com \
--cc=navasile@linux.microsoft.com \
--cc=pallavi.kadam@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).