From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id A582E1B5F0 for ; Thu, 2 Nov 2017 14:58:27 +0100 (CET) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA2DsZig137761 for ; Thu, 2 Nov 2017 09:58:26 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e047dj5wf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 02 Nov 2017 09:58:26 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 Nov 2017 13:58:24 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 2 Nov 2017 13:58:22 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA2DwMB530277718; Thu, 2 Nov 2017 13:58:22 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D89E52043; Thu, 2 Nov 2017 12:52:21 +0000 (GMT) Received: from malvito.zurich.ibm.com (unknown [9.4.69.78]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 252995204C; Thu, 2 Nov 2017 12:52:21 +0000 (GMT) From: Jonas Pfefferle To: dev@dpdk.org Cc: anatoly.burakov@intel.com, chaozhu@linux.vnet.ibm.com, Jonas Pfefferle Date: Thu, 2 Nov 2017 14:58:19 +0100 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 17110213-0012-0000-0000-00000588C5A2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110213-0013-0000-0000-000019035929 Message-Id: <1509631099-31832-1-git-send-email-jpf@zurich.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-02_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711020176 Subject: [dpdk-dev] [PATCH] eal/ppc: revert fix mmap for memory initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Nov 2017 13:58:28 -0000 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 --- 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