From: Olivier Matz Date: Mon, 27 Jun 2016 15:58:51 +0000 (+0200) Subject: mem: revert page locking when not using hugepages X-Git-Tag: spdx-start~6330 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=729f17a932dde4a591b42184ccbb9076ae9fd00f;p=dpdk.git mem: revert page locking when not using hugepages This reverts commit 593a084afc2b441895aeca78a2c4465e450d0ef5. Since recently [1], it is not possible to run the dpdk with non-root privileges and the --no-huge option. This is because the eal layer tries to lock the memory. Using locked memory is mandatory for physical devices because they reference physical addresses. But a user may want to start the dpdk without locked memory, because he does not have the permission to do so, and/or does not have this need, for instance because he uses virtual drivers. So this commit reverts the use of MAP_LOCKED in mmap() flags. [1] http://www.dpdk.org/ml/archives/dev/2016-May/039404.html Fixes: 593a084afc2b ("mem: lock pages when not using hugepages") Reported-by: Panu Matilainen Signed-off-by: Olivier Matz --- diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 1220677840..5578c254d7 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -1159,7 +1159,7 @@ rte_eal_hugepage_init(void) /* hugetlbfs can be disabled */ if (internal_config.no_hugetlbfs) { addr = mmap(NULL, internal_config.memory, PROT_READ | PROT_WRITE, - MAP_LOCKED | MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); + MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); if (addr == MAP_FAILED) { RTE_LOG(ERR, EAL, "%s: mmap() failed: %s\n", __func__, strerror(errno));