From: Alexander Duyck <alexander.h.duyck@intel.com>
To: Andi Kleen <andi@firstfloor.org>
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, torvalds@linux-foundation.org
Subject: Re: [RFC PATCH 0/7] Improve swiotlb performance by using physical addresses
Date: Mon, 08 Oct 2012 08:43:19 -0700 [thread overview]
Message-ID: <5072F497.2000703@intel.com> (raw)
In-Reply-To: <20121006175751.GS16230@one.firstfloor.org>
On 10/06/2012 10:57 AM, Andi Kleen wrote:
>> Inlining everything did speed things up a bit, but I still didn't reach
>> the same speed I achieved using the patch set. However I did notice the
>> resulting swiotlb code was considerably larger.
> Thanks. So your patch makes sense, but imho should pursue the inlining
> in parallel for other call sites.
I'll try to take a look at getting that done this morning.
>> assembly, is replaced with 8 lines of assembly and becomes inline. In
>> addition we drop the number of calls to __phys_addr from 9 to 2 by
>> dropping them all from swiotlb. By my math I am probably saving about
>> 120 instructions per packet. I suspect all of that would probably be
>> cutting the number of instructions per packet enough to probably account
>> for a 5% difference when you consider I am running at about 1.5Mpps per
>> core on a 2.7Ghz processor.
> Maybe it's just me, but that's somehow sad for one if() and a subtraction
Well there is also all of the setup of the call on the function stack.
By my count just the portion that is used in the standard case is about
9 lines of assembly. By inlining it and dropping the if case we can
probably drop it to 1.
> BTW __pa used to be a simple subtraction, the if () was just added to
> handle the few call sites for x86-64 that do __pa(&text_symbol).
> Maybe we should just go back to the old __pa_symbol() for those cases,
> then __pa could be the simple subtraction it used to was again
> and it could be inlined and everyone would be happy.
>
> -Andi
What I am probably looking at doing is splitting the function in two as
you suggest where we have a separate function for the text symbol case.
I will probably also take the 32 bit approach and add a debug version
that is still a separate function for uses such as determining if we
have any callers who should be using __pa_symbol instead of __pa.
Thanks,
Alex
next prev parent reply other threads:[~2012-10-08 15:43 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 ` [RFC PATCH 0/7] Improve swiotlb performance by using physical addresses Konrad Rzeszutek Wilk
2012-10-04 15:50 ` 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 [this message]
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=5072F497.2000703@intel.com \
--to=alexander.h.duyck@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--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=torvalds@linux-foundation.org \
--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).