linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sunil Kovvuri <sunil.kovvuri@gmail.com>
To: Robin Murphy <robin.murphy@arm.com>
Cc: David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>,
	Sunil Goutham <sgoutham@cavium.com>,
	LKML <linux-kernel@vger.kernel.org>,
	LAKML <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/4] net: thunderx: Fix IOMMU translation faults
Date: Tue, 7 Mar 2017 18:14:31 +0530	[thread overview]
Message-ID: <CA+sq2CfCS1aQGtCwVxhzMU3QmKy+tE6j2Zvq=U9aTodvDTFdvA@mail.gmail.com> (raw)
In-Reply-To: <9a809c6e-3b01-4deb-e69e-65aa62d1e5e1@arm.com>

On Mon, Mar 6, 2017 at 10:02 PM, Robin Murphy <robin.murphy@arm.com> wrote:
> On 06/03/17 12:57, Sunil Kovvuri wrote:
>>>>
>>>> We are seeing a 0.75Mpps drop with IP forwarding rate due to that.
>>>> Hence I have restricted calling DMA interfaces to only when IOMMU is enabled.
>>>
>>> What's 0.07Mpps as a percentage of baseline? On a correctly configured
>>> coherent arm64 system, in the absence of an IOMMU, dma_map_*() is
>>> essentially just virt_to_phys() behind a function call or two, so I'd be
>>> interested to know where any non-trivial overhead might be coming from.
>>
>> It's a 5% drop and yes device is configured as coherent.
>> And the drop is due to additional function calls.
>
> OK, interesting - sounds like there's potential for some optimisation
> there as well. AFAICS the callchain goes:
>
> dma_map_single_attrs (inline)
> - ops->map_page (__swiotlb_map_page)
>   - swiotlb_map_page
>     - phys_to_dma (inline)
>     - dma_capable (inline)
>
> Do you happen to have a breakdown of where the time goes? If it's mostly
> just in the indirect branch our options are limited (I'm guessing
> ThunderX doesn't have a particularly fancy branch predictor, if it's not
> even got a data prefetcher), but if it's in the SWIOTLB code then
> there's certainly room for improvement (which will hopefully tie in with
> some DMA ops work I'm planning to do soon anyway).

It's the branching which is costing the performance, as you said nothing
much can be done in the common code for this. Anyway I have submitted
new patch without conditional calling of DMA APIs, will look into reducing
performance impact (if possible implement recycling) a bit later.

Thanks,
Sunil.

  reply	other threads:[~2017-03-07 12:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03 10:47 [PATCH 0/4] net: thunderx: Miscellaneous fixes sunil.kovvuri
2017-03-03 10:47 ` [PATCH 1/4] net: thunderx: Fix IOMMU translation faults sunil.kovvuri
2017-03-03 17:56   ` David Miller
2017-03-04  5:54     ` Sunil Kovvuri
2017-03-06 12:46       ` Robin Murphy
2017-03-06 12:57         ` Sunil Kovvuri
2017-03-06 16:32           ` Robin Murphy
2017-03-07 12:44             ` Sunil Kovvuri [this message]
2017-03-03 10:47 ` [PATCH 2/4] net: thunderx: Fix LMAC mode debug prints for QSGMII mode sunil.kovvuri
2017-03-03 10:47 ` [PATCH 3/4] net: thunderx: Fix invalid mac addresses for node1 interfaces sunil.kovvuri
2017-03-03 10:47 ` [PATCH 4/4] net: thunderx: Allow IPv6 frames with zero UDP checksum sunil.kovvuri

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='CA+sq2CfCS1aQGtCwVxhzMU3QmKy+tE6j2Zvq=U9aTodvDTFdvA@mail.gmail.com' \
    --to=sunil.kovvuri@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sgoutham@cavium.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).