patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>
To: pradeep@us.ibm.com, Chao Zhu <chaozhu@linux.vnet.ibm.com>
Cc: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>,
	stable@dpdk.org
Subject: [dpdk-stable] [PATCH 0/3] eal: clean up mapping hugepages in secondary process for ppc64le
Date: Wed, 23 May 2018 18:23:21 +0530	[thread overview]
Message-ID: <cover.1527076172.git.gowrishankar.m@linux.vnet.ibm.com> (raw)

From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>

Earlier powerpc arch encountered an issue in secondary process
to map hugepages in same VA range as mapped by primary process.
By then, proposed fix was to use nr_overcommit_hugepages from 
the kernel and mmap using MAP_HUGETLB|MAP_ANONYMOUS flags. Though
it solved respecting address hints in mmap calls, this fix
introduced limitation of maximum VA space that, primary process
in DPDK can create upon hugepages, to physical RAM size (almost).

This patch cleans up this limitation by

 1. reverting the previous patch so that, virtual address space
    range is not a constraint (like other arch).
        
 2. reverse-indexing on hugepage files as the secondary
    process mmap them. Reversed addressing sequence makes 
    this mandate.
    
 3. Move slightly where munmap() is called in zero-mapped VA
    block, as secondary process would attach them.
    
All these changes has also been verified in x86 arch (and request
other arch maintainers too test this and give feedback).

Fixes: 284ae3e9ff ("eal/ppc: fix mmap for memory initialization")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>


IBM Internal:
=============
Refer to below bug to understand powerpc memory slice op:
 * https://bugzilla.linux.ibm.com/show_bug.cgi?id=141628#c2

This patch overcomes multiples issues we have been facing until 
now:

 * EAL: Cannot get a virtual area: Cannot allocate memory - warning misleading end users.
 * Multiple memsegs leading heap corruption for rte_malloc (https://dpdk.org/ml/archives/dev/2018-May/100085.html)
 * Bug 166908 - net/mlx5: RXQ allocation failure when sysfs vm.nr_overcommit_hugepages enabled
 * Bug 166960 - lpm: memory allocation failed as applications start when nr_overcommit_hugepages set

I am doing more validations on the patches, as I see initial tests pass from these known issues.

 * http://pastebin.hursley.ibm.com/12493

Gowrishankar Muthukrishnan (3):
  eal: access hugepage_file in reverse order for powerpc
  eal: reorder calling munmap on zero-mapped memory
  eal: reverse powerpc changes done for hugepage overcommit

 doc/guides/linux_gsg/sys_reqs.rst        |  6 ------
 lib/librte_eal/linuxapp/eal/eal_memory.c | 22 +++++++++-------------
 2 files changed, 9 insertions(+), 19 deletions(-)

-- 
1.9.1

WARNING: multiple messages have this Message-ID
From: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>
To: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: stable@dpdk.org, Chao Zhu <chaozhu@linux.vnet.ibm.com>,
	Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Subject: [dpdk-stable] [PATCH 0/3] eal: clean up mapping hugepages in secondary process for ppc64le
Date: Thu, 21 Jun 2018 10:57:35 +0530	[thread overview]
Message-ID: <cover.1527076172.git.gowrishankar.m@linux.vnet.ibm.com> (raw)
Message-ID: <20180621052735.MhaYSTDlmvCh7auvzo0BWoCf7syaqqPKECI6SZM18ao@z> (raw)

From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>

Earlier powerpc arch encountered an issue in secondary process
to map hugepages in same VA range as mapped by primary process.
By then, proposed fix was to use nr_overcommit_hugepages from 
the kernel and mmap using MAP_HUGETLB|MAP_ANONYMOUS flags. Though
it solved respecting address hints in mmap calls, this fix
introduced limitation of maximum VA space that, primary process
in DPDK can create upon hugepages, to physical RAM size (almost).

This patch cleans up this limitation by

 1. reverting the previous patch so that, virtual address space
    range is not a constraint (like other arch).
        
 2. reverse-indexing on hugepage files as the secondary
    process mmap them. Reversed addressing sequence makes 
    this mandate.
    
 3. Move slightly where munmap() is called in zero-mapped VA
    block, as secondary process would attach them.
    
All these changes has also been verified in x86 arch (and request
other arch maintainers too test this and give feedback).

Fixes: 284ae3e9ff ("eal/ppc: fix mmap for memory initialization")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>


Gowrishankar Muthukrishnan (3):
  eal: access hugepage_file in reverse order for powerpc
  eal: reorder calling munmap on zero-mapped memory
  eal: reverse powerpc changes done for hugepage overcommit

 doc/guides/linux_gsg/sys_reqs.rst        |  6 ------
 lib/librte_eal/linuxapp/eal/eal_memory.c | 22 +++++++++-------------
 2 files changed, 9 insertions(+), 19 deletions(-)

-- 
1.9.1

             reply	other threads:[~2018-05-23 12:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 12:53 Gowrishankar [this message]
2018-06-21  5:27 ` Gowrishankar
2018-06-21  5:27 ` [dpdk-stable] [PATCH 1/3] eal: access hugepage_file in reverse order for powerpc Gowrishankar
2018-06-21  5:27 ` [dpdk-stable] [PATCH 2/3] eal: reorder calling munmap on zero-mapped memory Gowrishankar
2018-06-21  5:27 ` [dpdk-stable] [PATCH 3/3] eal: reverse powerpc changes done for hugepage overcommit Gowrishankar
2018-06-21  8:50 ` [dpdk-stable] [PATCH 0/3] eal: clean up mapping hugepages in secondary process for ppc64le Luca Boccassi
2018-06-21  8:54   ` gowrishankar muthukrishnan

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=cover.1527076172.git.gowrishankar.m@linux.vnet.ibm.com \
    --to=gowrishankar.m@linux.vnet.ibm.com \
    --cc=chaozhu@linux.vnet.ibm.com \
    --cc=pradeep@us.ibm.com \
    --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).