patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: Alejandro Lucero <alejandro.lucero@netronome.com>
Cc: dpdk stable <stable@dpdk.org>,
	Eelco Chaudron <echaudro@redhat.com>,
	ovs dev <dev@openvswitch.org>,
	Kevin Traynor <ktraynor@redhat.com>,
	"Burakov, Anatoly" <anatoly.burakov@intel.com>
Subject: Re: [dpdk-stable] [PATCH 17.11] mem: fix memory initialization time
Date: Wed, 28 Nov 2018 23:04:35 +0000	[thread overview]
Message-ID: <ECBAE1C9-41B4-4999-A9F3-D1721046F52B@mellanox.com> (raw)
In-Reply-To: <20181112111819.25087-1-alejandro.lucero@netronome.com>

> On Nov 12, 2018, at 3:18 AM, Alejandro Lucero <alejandro.lucero@netronome.com> wrote:
> 
> When using large amount of hugepage based memory, doing all the
> hugepages mapping can take quite significant time.
> 
> The problem is hugepages being initially mmaped to virtual addresses
> which will be tried later for the final hugepage mmaping. This causes
> the final mapping requiring calling mmap with another hint address which
> can happen several times, depending on the amount of memory to mmap, and
> which each mmmap taking more than a second.
> 
> This patch changes the hint for the initial hugepage mmaping using
> a starting address which will not collide with the final mmaping.
> 
> Fixes: 293c0c4b957f ("mem: use address hint for mapping hugepages")
> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
> ---

Applied to stable/17.11

Thanks,
Yongseok

> lib/librte_eal/linuxapp/eal/eal_memory.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
> index bac969a12..0675809b7 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_memory.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
> @@ -421,6 +421,21 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi,
> 	}
> #endif
> 
> +#ifdef RTE_ARCH_64
> +	/*
> +	 * Hugepages are first mmaped individually and then re-mmapped to
> +	 * another region for having contiguous physical pages in contiguous
> +	 * virtual addresses. Setting here vma_addr for the first hugepage
> +	 * mapped to a virtual address which will not collide with the second
> +	 * mmaping later. The next hugepages will use increments of this
> +	 * initial address.
> +	 *
> +	 * The final virtual address will be based on baseaddr which is
> +	 * 0x100000000. We use a hint here starting at 0x200000000, leaving
> +	 * another 4GB just in case, plus the total available hugepages memory.
> +	 */
> +	vma_addr = (char *)0x200000000 + (hpi->hugepage_sz * hpi->num_pages[0]);
> +#endif
> 	for (i = 0; i < hpi->num_pages[0]; i++) {
> 		uint64_t hugepage_sz = hpi->hugepage_sz;
> 
> -- 
> 2.17.1
> 

      parent reply	other threads:[~2018-11-28 23:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 11:18 Alejandro Lucero
2018-11-12 11:26 ` Eelco Chaudron
2018-11-14 12:45   ` [dpdk-stable] [dpdk-dev] " Eelco Chaudron
2018-11-15 13:16 ` Burakov, Anatoly
2018-11-16 12:49   ` Alejandro Lucero
2018-11-16 13:35     ` Burakov, Anatoly
2018-11-16 14:42       ` Alejandro Lucero
2018-11-16 15:56         ` Burakov, Anatoly
2018-11-28 23:04 ` Yongseok Koh [this message]

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=ECBAE1C9-41B4-4999-A9F3-D1721046F52B@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=alejandro.lucero@netronome.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@openvswitch.org \
    --cc=echaudro@redhat.com \
    --cc=ktraynor@redhat.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).