patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Dmitry Kozlyuk <dkozlyuk@nvidia.com>, <dev@dpdk.org>
Cc: <stable@dpdk.org>, Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	"Xiaoyun Li" <xiaoyun.li@intel.com>,
	Aman Singh <aman.deep.singh@intel.com>
Subject: Re: [PATCH] app/testpmd: fix external buffer allocation
Date: Tue, 18 Jan 2022 13:28:48 +0000	[thread overview]
Message-ID: <53602308-20aa-f736-9847-f688b2fc40bf@intel.com> (raw)
In-Reply-To: <20211217095816.2599242-1-dkozlyuk@nvidia.com>

On 12/17/2021 9:58 AM, Dmitry Kozlyuk wrote:
> External pinned buffer memory (--mp-alloc=xbuf)
> was allocated as multiple IOVA-contiguous memzones
> of 2M size and 2M alignment.
> Due to the malloc overhead and the alignment requirement,
> each 2M memzone consumed 4M of hugepage memory:
> 2M of usable memory + X of malloc overhead + (2M-X) padding.
> The allocation often failed with 2M hugepages and IOVA-as-PA
> if a PA-contiguous span of 2 hugepages could not be found.
> Also, with any hugepage size and IOVA mode
> memory consumption was almost 2x of the usable amount.
> 
> Alignment requirement of 2M for external buffers is redundant.
> It was an attempt to ensure IOVA-contiguity
> by forcing memzones to start at hugepage boundaries,
> while 2M size intended to leave no unused space on the page.
> As shown above, this in fact caused excessive memory consumption
> and decreased the chance of a successful allocation.
> RTE_MEMZONE_F_IOVA_CONTIG already ensures IOVA-contiguity.
> 
> Remove the alignment requirement.
> Reduce the memzone size by the malloc overhead size (4 cache lines),
> so that memory consumption for each memzone is
> (2M-X) of usable memory + X of malloc overhead = 2M.
> This also means that whenever there are free 2M hugepages,
> an IOVA-contiguous memzone can always be allocated.
> 
> Fixes: 72512e1897b2 ("app/testpmd: add mempool with external data buffers")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Applied to dpdk-next-net/main, thanks.


      reply	other threads:[~2022-01-18 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17  9:58 Dmitry Kozlyuk
2022-01-18 13:28 ` Ferruh Yigit [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=53602308-20aa-f736-9847-f688b2fc40bf@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=dkozlyuk@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    --cc=xiaoyun.li@intel.com \
    /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).