DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Ray Kinsella <mdr@ashroe.eu>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vfio: map contiguous areas in one go
Date: Tue, 25 Feb 2020 14:21:08 +0000	[thread overview]
Message-ID: <b80fdb98-2530-76fe-e38c-be9231144564@intel.com> (raw)
In-Reply-To: <276c85ed-ac2f-52c9-dffc-18ce41ab0f35@ashroe.eu>

On 25-Feb-20 1:49 PM, Ray Kinsella wrote:
> Hi Anatoly,
> 
> On 25/02/2020 13:24, Anatoly Burakov wrote:
>> Currently, when we are creating DMA mappings for memory that's
>> either external or is backed by hugepages in IOVA as PA mode, we
>> assume that each page is necessarily discontiguous. This may not
>> actually be the case, especially for external memory, where the
>> user is able to create their own IOVA table and make it
>> contiguous. This is a problem because VFIO has a limited number
>> of DMA mappings, and it does not appear to concatenate them and
>> treats each mapping as separate, even when they cover adjacent
>> areas.
>>> Fix this so that we always map contiguous memory in a single
>> chunk, as opposed to mapping each segment separately.
> 
> Can I confirm my understanding.
> 
> We are essentially correcting user errant behavior,
> trading off startup/mapping time to save IOMMU resources?
> 

That's not quite what we're doing.

First of all, in terms of "trading startup/mapping time", i think this 
will actually be faster because the DMA map is the more 
resource-intensive part of this loop by far, and we're doing _less_ of 
those (because we're concatenating). We're also doing the same number of 
loop iterations as before.

To be perfectly clear: we're not reordering segments here - segments 
have to be VA- and IOVA-contiguous in the first place, otherwise we're 
breaking them up. It's just that previously, we were also breaking up 
contiguous segments into separate, per-page mappings, but now we 
concatenate them.

-- 
Thanks,
Anatoly

  reply	other threads:[~2020-02-25 14:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 13:24 Anatoly Burakov
2020-02-25 13:49 ` Ray Kinsella
2020-02-25 14:21   ` Burakov, Anatoly [this message]
2020-03-27 10:13 ` David Marchand

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=b80fdb98-2530-76fe-e38c-be9231144564@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=mdr@ashroe.eu \
    /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).