From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>,
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 1/7] swiotlb: Instead of tracking the end of the swiotlb region just calculate it
Date: Thu, 4 Oct 2012 12:31:02 -0400 [thread overview]
Message-ID: <20121004163102.GB12128@phenom.dumpdata.com> (raw)
In-Reply-To: <506DB121.3020700@intel.com>
On Thu, Oct 04, 2012 at 08:54:09AM -0700, Alexander Duyck wrote:
> On 10/04/2012 06:01 AM, Konrad Rzeszutek Wilk wrote:
> > On Wed, Oct 03, 2012 at 05:38:47PM -0700, Alexander Duyck wrote:
> >> In the case of swiotlb we already have the start of the region and the number
> >> of slabs that give us the region size. Instead of having to call
> >> virt_to_phys on two pointers we can just take advantage of the fact that the
> >> region is linear and just compute the end based on the start plus the size.
> > Why not take advantage of 'the fact that the region is linear' and just
> > pre-compute the end in swiotlb_init_with_tbl?
> >
> > That way the logic in is_swiotlb_buffer is even simpler?
> >
>
> Using a pre-computed end point based on a virtual address is more
> expensive in the x86_64 case. The calls to __phys_addr require a
> separate function call. By just using the physical address of the start
> and adding the offset I can avoid the second call and the compiler will
> take advantage of the smaller function size. The result is that
> is_swiotlb_buffer will be inlined.
Right, that is not what I was thinking. My thought was that since you
are already computing the start of the DMA address, you can also
compute the end - and save both values in a global variable.
Then use said global variables to check for your DMA instead of
doing the extra compution of shifting to find the end of the DMA address.
>
> Thanks,
>
> Alex
next prev parent reply other threads:[~2012-10-04 16:42 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 [this message]
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
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=20121004163102.GB12128@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--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@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.