[dpdk-stable] patch 'malloc: notify primary process about hotplug in secondary' has been queued to LTS release 18.11.1

Kevin Traynor ktraynor at redhat.com
Fri Jan 4 14:24:13 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 01/11/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Kevin Traynor

---
>From 6d1a887d2e88ea5d46735d893e31ed8d247103c5 Mon Sep 17 00:00:00 2001
From: Seth Howell <seth.howell at intel.com>
Date: Fri, 7 Dec 2018 13:10:42 -0700
Subject: [PATCH] malloc: notify primary process about hotplug in secondary

[ upstream commit fba0ca227453ee6a60f674884531fb3817ca8a17 ]

When secondary process hotplugs memory, it sends a request
to primary, which then performs the real mmap() and sends
sync requests to all secondary processes. Upon receiving
such sync request, each secondary process will notify the
upper layers of hotplugged memory (and will call all
locally registered event callbacks).

In the end we'll end up with memory event callbacks fired
in all the processes except the primary, which is a bug.

This gets critical if memory is hotplugged while a VFIO
device is attached, as the VFIO memory registration -
which is done from a memory event callback present in the
primary process only - is never called.

After this patch, a primary process fires memory event
callbacks before secondary processes start their
synchronizations - both for hotplug and hotremove.

Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")

Signed-off-by: Seth Howell <seth.howell at intel.com>
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk at intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/librte_eal/common/malloc_mp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/librte_eal/common/malloc_mp.c b/lib/librte_eal/common/malloc_mp.c
index 5f2d4e0be..f3a13353b 100644
--- a/lib/librte_eal/common/malloc_mp.c
+++ b/lib/librte_eal/common/malloc_mp.c
@@ -210,4 +210,6 @@ handle_alloc_request(const struct malloc_mp_req *m,
 	map_addr = ms[0]->addr;
 
+	eal_memalloc_mem_event_notify(RTE_MEM_EVENT_ALLOC, map_addr, alloc_sz);
+
 	/* we have succeeded in allocating memory, but we still need to sync
 	 * with other processes. however, since DPDK IPC is single-threaded, we
@@ -259,4 +261,7 @@ handle_request(const struct rte_mp_msg *msg, const void *peer __rte_unused)
 		ret = handle_alloc_request(m, entry);
 	} else if (m->t == REQ_TYPE_FREE) {
+		eal_memalloc_mem_event_notify(RTE_MEM_EVENT_FREE,
+				m->free_req.addr, m->free_req.len);
+
 		ret = malloc_heap_free_pages(m->free_req.addr,
 				m->free_req.len);
@@ -437,4 +442,7 @@ handle_sync_response(const struct rte_mp_msg *request,
 
 		/* we've failed to sync, so do a rollback */
+		eal_memalloc_mem_event_notify(RTE_MEM_EVENT_FREE,
+				state->map_addr, state->map_len);
+
 		rollback_expand_heap(state->ms, state->ms_len, state->elem,
 				state->map_addr, state->map_len);
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-01-04 13:23:08.186953918 +0000
+++ 0031-malloc-notify-primary-process-about-hotplug-in-secon.patch	2019-01-04 13:23:07.000000000 +0000
@@ -1,8 +1,10 @@
-From fba0ca227453ee6a60f674884531fb3817ca8a17 Mon Sep 17 00:00:00 2001
+From 6d1a887d2e88ea5d46735d893e31ed8d247103c5 Mon Sep 17 00:00:00 2001
 From: Seth Howell <seth.howell at intel.com>
 Date: Fri, 7 Dec 2018 13:10:42 -0700
 Subject: [PATCH] malloc: notify primary process about hotplug in secondary
 
+[ upstream commit fba0ca227453ee6a60f674884531fb3817ca8a17 ]
+
 When secondary process hotplugs memory, it sends a request
 to primary, which then performs the real mmap() and sends
 sync requests to all secondary processes. Upon receiving
@@ -23,7 +25,6 @@
 synchronizations - both for hotplug and hotremove.
 
 Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")
-Cc: stable at dpdk.org
 
 Signed-off-by: Seth Howell <seth.howell at intel.com>
 Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk at intel.com>


More information about the stable mailing list