From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0C30AA0471 for ; Fri, 21 Jun 2019 18:51:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EFD3A1D587; Fri, 21 Jun 2019 18:51:44 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 73BCC1D55F for ; Fri, 21 Jun 2019 18:51:43 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B07EA2F8BC7; Fri, 21 Jun 2019 16:51:32 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-77.ams2.redhat.com [10.36.117.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0450660BE0; Fri, 21 Jun 2019 16:51:10 +0000 (UTC) From: Kevin Traynor To: Nicolas Dichtel Cc: Olivier Matz , Didier Pallard , David Marchand , Anatoly Burakov , dpdk stable Date: Fri, 21 Jun 2019 17:46:08 +0100 Message-Id: <20190621164626.31219-24-ktraynor@redhat.com> In-Reply-To: <20190621164626.31219-1-ktraynor@redhat.com> References: <20190621164626.31219-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 21 Jun 2019 16:51:34 +0000 (UTC) Subject: [dpdk-stable] patch 'mem: ease init in a docker container' has been queued to LTS release 18.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/26/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/f81c31bcea0b4806284a65a325ca4c268276bdd8 Thanks. Kevin Traynor --- >From f81c31bcea0b4806284a65a325ca4c268276bdd8 Mon Sep 17 00:00:00 2001 From: Nicolas Dichtel Date: Thu, 23 May 2019 11:52:31 +0200 Subject: [PATCH] mem: ease init in a docker container [ upstream commit 2a96c88be83e3101c3915c2af8c03158aeb605a7 ] move_pages() is only used to get the numa node id, but this function is not allowed by default in docker (it needs CAP_SYS_NICE and an update of the seccomp profile). get_mempolicy() also requires CAP_SYS_NICE but doesn't need any change in the default seccomp profile. Note that the returned value of move_pages() was not checked, thus some errors could be hidden (if the requested id was 0). Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime") Signed-off-by: Nicolas Dichtel Reviewed-by: Olivier Matz Reviewed-by: Didier Pallard Reviewed-by: David Marchand Acked-by: Anatoly Burakov --- lib/librte_eal/linuxapp/eal/eal_memalloc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c index 81b441a96..f85c1f398 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c +++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c @@ -733,7 +733,11 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id, #ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES - move_pages(getpid(), 1, &addr, NULL, &cur_socket_id, 0); - - if (cur_socket_id != socket_id) { + ret = get_mempolicy(&cur_socket_id, NULL, 0, addr, + MPOL_F_NODE | MPOL_F_ADDR); + if (ret < 0) { + RTE_LOG(DEBUG, EAL, "%s(): get_mempolicy: %s\n", + __func__, strerror(errno)); + goto mapped; + } else if (cur_socket_id != socket_id) { RTE_LOG(DEBUG, EAL, "%s(): allocation happened on wrong socket (wanted %d, got %d)\n", -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-06-21 17:22:12.996968243 +0100 +++ 0024-mem-ease-init-in-a-docker-container.patch 2019-06-21 17:22:11.735518853 +0100 @@ -1 +1 @@ -From 2a96c88be83e3101c3915c2af8c03158aeb605a7 Mon Sep 17 00:00:00 2001 +From f81c31bcea0b4806284a65a325ca4c268276bdd8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2a96c88be83e3101c3915c2af8c03158aeb605a7 ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ - lib/librte_eal/linux/eal/eal_memalloc.c | 10 +++++++--- + lib/librte_eal/linuxapp/eal/eal_memalloc.c | 10 +++++++--- @@ -27,5 +28,5 @@ -diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c b/lib/librte_eal/linux/eal/eal_memalloc.c -index b1849a28a..2019636fb 100644 ---- a/lib/librte_eal/linux/eal/eal_memalloc.c -+++ b/lib/librte_eal/linux/eal/eal_memalloc.c -@@ -600,7 +600,11 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id, +diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c +index 81b441a96..f85c1f398 100644 +--- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c ++++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c +@@ -733,7 +733,11 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id,