DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH] mem: warn user when running without NUMA support
Date: Fri, 22 Feb 2019 15:59:24 +0000	[thread overview]
Message-ID: <72f990b04219f319b2922570a7ca7b9ce93e0aae.1550851129.git.anatoly.burakov@intel.com> (raw)

Running in non-legacy mode on a NUMA-enabled system without libnuma
is unsupported, so explicitly print out a warning when trying to
do so.

Running in legacy mode without libnuma is still supported whether or
not we are running with libnuma support enabled, so also fix init to
allow that scenario.

Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_memalloc.c |  3 +++
 lib/librte_eal/linuxapp/eal/eal_memory.c   | 14 ++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c
index b6fb183db..4e83a1a19 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c
@@ -725,6 +725,9 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id,
 			__func__, socket_id, cur_socket_id);
 		goto mapped;
 	}
+#else
+	if (rte_socket_count() > 1)
+		RTE_LOG(DEBUG, EAL, "%s(): not checking hugepage NUMA node.\n");
 #endif
 
 	ms->addr = addr;
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 1b96b576e..e5a0e57ff 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -50,6 +50,7 @@
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 #include "eal_hugepages.h"
+#include "eal_options.h"
 
 #define PFN_MASK_SIZE	8
 
@@ -2088,7 +2089,8 @@ memseg_primary_init_32(void)
 		socket_id = rte_socket_id_by_idx(i);
 
 #ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES
-		if (socket_id > 0)
+		/* we can still sort pages by socket in legacy mode */
+		if (!internal_config.legacy_mem && socket_id > 0)
 			break;
 #endif
 
@@ -2269,7 +2271,8 @@ memseg_primary_init(void)
 			int socket_id = rte_socket_id_by_idx(i);
 
 #ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES
-			if (socket_id > 0)
+			/* we can still sort pages by socket in legacy mode */
+			if (!internal_config.legacy_mem && socket_id > 0)
 				break;
 #endif
 			memtypes[cur_type].page_sz = hugepage_sz;
@@ -2428,6 +2431,13 @@ rte_eal_memseg_init(void)
 	} else {
 		RTE_LOG(ERR, EAL, "Cannot get current resource limits\n");
 	}
+#ifndef RTE_EAL_NUMA_AWARE_HUGEPAGES
+	if (!internal_config.legacy_mem && rte_socket_count() > 1) {
+		RTE_LOG(WARNING, EAL, "DPDK is running on a NUMA system, but is compiled without NUMA support.\n");
+		RTE_LOG(WARNING, EAL, "This will have adverse consequences for performance and usability.\n");
+		RTE_LOG(WARNING, EAL, "Please use --"OPT_LEGACY_MEM" option, or recompile with NUMA support.\n");
+	}
+#endif
 
 	return rte_eal_process_type() == RTE_PROC_PRIMARY ?
 #ifndef RTE_ARCH_64
-- 
2.17.1

             reply	other threads:[~2019-02-22 15:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 15:59 Anatoly Burakov [this message]
2019-03-27 10:31 ` Thomas Monjalon
2019-03-27 10:31   ` Thomas Monjalon
2019-03-27 11:52   ` Burakov, Anatoly
2019-03-27 11:52     ` Burakov, Anatoly
2019-03-27 13:35 ` [dpdk-dev] [PATCH v2] " Anatoly Burakov
2019-03-27 13:35   ` Anatoly Burakov
2019-03-28 20:29   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-03-28 20:29     ` Thomas Monjalon
2019-03-29 12:30   ` [dpdk-dev] [PATCH v3] " Anatoly Burakov
2019-03-29 12:30     ` Anatoly Burakov
2019-03-29 12:43     ` Thomas Monjalon
2019-03-29 12:43       ` Thomas Monjalon
2019-03-29 14:01     ` [dpdk-dev] [PATCH v4] " Anatoly Burakov
2019-03-29 14:01       ` Anatoly Burakov
2019-03-29 23:27       ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-03-29 23:27         ` 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=72f990b04219f319b2922570a7ca7b9ce93e0aae.1550851129.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).