linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: konrad.wilk@oracle.com, tglx@linutronix.de, mingo@redhat.com,
	hpa@zytor.com, rob@landley.net, akpm@linux-foundation.org,
	joerg.roedel@amd.com, bhelgaas@google.com, shuahkhan@gmail.com,
	linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
	x86@kernel.org
Subject: Re: [RFC PATCH 0/7] Improve swiotlb performance by using physical addresses
Date: Thu, 4 Oct 2012 08:55:47 -0400	[thread overview]
Message-ID: <20121004125546.GA9158@phenom.dumpdata.com> (raw)
In-Reply-To: <20121004002113.5016.66913.stgit@gitlad.jf.intel.com>

On Wed, Oct 03, 2012 at 05:38:41PM -0700, Alexander Duyck wrote:
> While working on 10Gb/s routing performance I found a significant amount of
> time was being spent in the swiotlb DMA handler.  Further digging found that a
> significant amount of this was due to the fact that virtual to physical
> address translation and calling the function that did it.  It accounted for
> nearly 60% of the total overhead.
> 
> This patch set works to resolve that by changing the io_tlb_start address and
> io_tlb_overflow_buffer address from virtual addresses to physical addresses.
> By doing this, devices that are not making use of bounce buffers can
> significantly reduce their overhead.  In addition I followed through with the

.. but are still using SWIOTLB for their DMA operations, right?

> cleanup to the point that the only functions that really require the virtual
> address for the dma buffer are the init, free, and bounce functions.
> 
> When running a routing throughput test using small packets I saw roughly a 5%
> increase in packets rates after applying these patches.  This appears to match
> up with the CPU overhead reduction I was tracking via perf.
> 
> Before:
> Results 10.29Mps
> # Overhead Symbol
> # ........ ...........................................................................................................
> #
>      1.97%  [k] __phys_addr                                                                                   
>             |              
>             |--24.97%-- swiotlb_sync_single
>             |          
>             |--16.55%-- is_swiotlb_buffer
>             |          
>             |--11.25%-- unmap_single
>             |          
>              --2.71%-- swiotlb_dma_mapping_error
>      1.66%  [k] swiotlb_sync_single                                                                                 
>      1.45%  [k] is_swiotlb_buffer                                     
>      0.53%  [k] unmap_single                                                                                     
>      0.52%  [k] swiotlb_map_page                                      
>      0.47%  [k] swiotlb_sync_single_for_device                                                                 
>      0.43%  [k] swiotlb_sync_single_for_cpu                           
>      0.42%  [k] swiotlb_dma_mapping_error                                                               
>      0.34%  [k] swiotlb_unmap_page                
> 
> After:
> Results 10.99Mps
> # Overhead Symbol
> # ........ ...........................................................................................................
> #
>      0.50%  [k] swiotlb_map_page                                                                                        
>      0.50%  [k] swiotlb_sync_single                                                                                     
>      0.36%  [k] swiotlb_sync_single_for_cpu                                                                             
>      0.35%  [k] swiotlb_sync_single_for_device                                                                          
>      0.25%  [k] swiotlb_unmap_page                                                                                      
>      0.17%  [k] swiotlb_dma_mapping_error  
> 
> ---
> 
> Alexander Duyck (7):
>       swiotlb:  Do not export swiotlb_bounce since there are no external consumers
>       swiotlb: Use physical addresses instead of virtual in swiotlb_tbl_sync_single
>       swiotlb: Use physical addresses for swiotlb_tbl_unmap_single
>       swiotlb: Return physical addresses when calling swiotlb_tbl_map_single
>       swiotlb: Make io_tlb_overflow_buffer a physical address
>       swiotlb: Make io_tlb_start a physical address instead of a virtual address
>       swiotlb: Instead of tracking the end of the swiotlb region just calculate it
> 
> 
>  drivers/xen/swiotlb-xen.c |   25 ++---
>  include/linux/swiotlb.h   |   20 ++--
>  lib/swiotlb.c             |  247 +++++++++++++++++++++++----------------------
>  3 files changed, 150 insertions(+), 142 deletions(-)
> 
> -- 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

  parent reply	other threads:[~2012-10-04 13:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-04  0:38 [RFC PATCH 0/7] Improve swiotlb performance by using physical addresses Alexander Duyck
2012-10-04  0:38 ` [RFC PATCH 1/7] swiotlb: Instead of tracking the end of the swiotlb region just calculate it Alexander Duyck
2012-10-04 13:01   ` Konrad Rzeszutek Wilk
2012-10-04 15:54     ` Alexander Duyck
2012-10-04 16:31       ` Konrad Rzeszutek Wilk
2012-10-04  0:38 ` [RFC PATCH 2/7] swiotlb: Make io_tlb_start a physical address instead of a virtual address Alexander Duyck
2012-10-04 13:18   ` Konrad Rzeszutek Wilk
2012-10-04 17:11     ` Alexander Duyck
2012-10-04 17:19       ` Konrad Rzeszutek Wilk
2012-10-04 20:22         ` Alexander Duyck
2012-10-09 16:43           ` Konrad Rzeszutek Wilk
2012-10-09 19:11             ` Alexander Duyck
2012-10-04  0:38 ` [RFC PATCH 3/7] swiotlb: Make io_tlb_overflow_buffer a physical address Alexander Duyck
2012-10-04  0:39 ` [RFC PATCH 4/7] swiotlb: Return physical addresses when calling swiotlb_tbl_map_single Alexander Duyck
2012-10-04  0:39 ` [RFC PATCH 5/7] swiotlb: Use physical addresses for swiotlb_tbl_unmap_single Alexander Duyck
2012-10-04  0:39 ` [RFC PATCH 6/7] swiotlb: Use physical addresses instead of virtual in swiotlb_tbl_sync_single Alexander Duyck
2012-10-04  0:39 ` [RFC PATCH 7/7] swiotlb: Do not export swiotlb_bounce since there are no external consumers Alexander Duyck
2012-10-04 12:55 ` Konrad Rzeszutek Wilk [this message]
2012-10-04 15:50   ` [RFC PATCH 0/7] Improve swiotlb performance by using physical addresses Alexander Duyck
2012-10-04 13:33 ` Konrad Rzeszutek Wilk
2012-10-04 17:57   ` Alexander Duyck
2012-10-05 16:55 ` Andi Kleen
2012-10-05 19:35   ` Alexander Duyck
2012-10-05 20:02     ` Andi Kleen
2012-10-05 23:23       ` Alexander Duyck
2012-10-06 17:57         ` Andi Kleen
2012-10-06 18:56           ` H. Peter Anvin
2012-10-08 15:43           ` Alexander Duyck
2012-10-09 19:05             ` Alexander Duyck

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=20121004125546.GA9158@phenom.dumpdata.com \
    --to=konrad@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.h.duyck@intel.com \
    --cc=bhelgaas@google.com \
    --cc=devel@linuxdriverproject.org \
    --cc=hpa@zytor.com \
    --cc=joerg.roedel@amd.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rob@landley.net \
    --cc=shuahkhan@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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).