DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jonas Pfefferle <jpf@zurich.ibm.com>
To: dev@dpdk.org
Cc: anatoly.burakov@intel.com, chaozhu@linux.vnet.ibm.com,
	Jonas Pfefferle <jpf@zurich.ibm.com>
Subject: [dpdk-dev] [PATCH] eal/ppc: revert fix mmap for memory initialization
Date: Thu,  2 Nov 2017 14:58:19 +0100	[thread overview]
Message-ID: <1509631099-31832-1-git-send-email-jpf@zurich.ibm.com> (raw)

This reverts commit 284ae3e9ff9a92575c28c858efd2c85c8de6d440
("eal/ppc: fix mmap for memory initialization").The logic if the
address hint is respected on mmap is no different on POWER than
on x86 however the address layout of userspace applications might
be slightly different i.e. you might need to use a different
virt-baseaddr. We now warn if the address hint is not respected
(fae209f) thus users can try different virtual address bases.

Fixes: 284ae3e9 ("eal/ppc: fix mmap for memory initialization")

Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com>
---
 doc/guides/linux_gsg/sys_reqs.rst        |  6 ------
 lib/librte_eal/linuxapp/eal/eal_memory.c | 18 +++---------------
 2 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
index 3e7fe63..ee69c1a 100644
--- a/doc/guides/linux_gsg/sys_reqs.rst
+++ b/doc/guides/linux_gsg/sys_reqs.rst
@@ -207,12 +207,6 @@ On a NUMA machine, pages should be allocated explicitly on separate nodes::
 
     For 1G pages, it is not possible to reserve the hugepage memory after the system has booted.
 
-    On IBM POWER system, the nr_overcommit_hugepages should be set to the same value as nr_hugepages.
-    For example, if the required page number is 128, the following commands are used::
-
-        echo 128 > /sys/kernel/mm/hugepages/hugepages-16384kB/nr_hugepages
-        echo 128 > /sys/kernel/mm/hugepages/hugepages-16384kB/nr_overcommit_hugepages
-
 Using Hugepages with the DPDK
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index ddf88c5..d92f163 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -273,14 +273,8 @@ get_virtual_area(size_t *size, size_t hugepage_sz)
 		return NULL;
 	}
 	do {
-		addr = mmap(addr,
-				(*size) + hugepage_sz, PROT_READ,
-#ifdef RTE_ARCH_PPC_64
-				MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB,
-#else
-				MAP_PRIVATE,
-#endif
-				fd, 0);
+		addr = mmap(addr, (*size) + hugepage_sz,
+				PROT_READ, MAP_PRIVATE, fd, 0);
 		if (addr == MAP_FAILED)
 			*size -= hugepage_sz;
 	} while (addr == MAP_FAILED && *size > 0);
@@ -1391,13 +1385,7 @@ rte_eal_hugepage_attach(void)
 		 * use mmap to get identical addresses as the primary process.
 		 */
 		base_addr = mmap(mcfg->memseg[s].addr, mcfg->memseg[s].len,
-				 PROT_READ,
-#ifdef RTE_ARCH_PPC_64
-				 MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB,
-#else
-				 MAP_PRIVATE,
-#endif
-				 fd_zero, 0);
+				 PROT_READ, MAP_PRIVATE, fd_zero, 0);
 		if (base_addr == MAP_FAILED ||
 		    base_addr != mcfg->memseg[s].addr) {
 			max_seg = s;
-- 
2.7.4

             reply	other threads:[~2017-11-02 13:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 13:58 Jonas Pfefferle [this message]
2017-11-06 23:30 ` 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=1509631099-31832-1-git-send-email-jpf@zurich.ibm.com \
    --to=jpf@zurich.ibm.com \
    --cc=anatoly.burakov@intel.com \
    --cc=chaozhu@linux.vnet.ibm.com \
    --cc=dev@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).