Re: [PATCH v2 1/7] swiotlb: Make io_tlb_end a physical addressinstead of a virtual one
From: Konrad Rzeszutek Wilk
Date: Thu Oct 18 2012 - 08:41:42 EST
On Mon, Oct 15, 2012 at 08:43:28AM -0700, Alexander Duyck wrote:
> On 10/13/2012 05:52 AM, Hillf Danton wrote:
> > Hi Alexander,
> > On Fri, Oct 12, 2012 at 4:34 AM, Alexander Duyck
> > <alexander.h.duyck@xxxxxxxxx> wrote:
> >> This change replaces all references to the virtual address for io_tlb_end
> >> with references to the physical address io_tlb_end. The main advantage of
> >> replacing the virtual address with a physical address is that we can avoid
> >> having to do multiple translations from the virtual address to the physical
> >> one needed for testing an existing DMA address.
> >> Signed-off-by: Alexander Duyck <alexander.h.duyck@xxxxxxxxx>
> >> ---
> >> lib/swiotlb.c | 24 +++++++++++++-----------
> >> 1 files changed, 13 insertions(+), 11 deletions(-)
> >> diff --git a/lib/swiotlb.c b/lib/swiotlb.c
> >> index f114bf6..19aac9f 100644
> >> --- a/lib/swiotlb.c
> >> +++ b/lib/swiotlb.c
> >> @@ -57,7 +57,8 @@ int swiotlb_force;
> >> * swiotlb_tbl_sync_single_*, to see if the memory was in fact allocated by this
> >> * API.
> >> */
> >> -static char *io_tlb_start, *io_tlb_end;
> >> +static char *io_tlb_start;
> >> +phys_addr_t io_tlb_end;
> > If add io_tlb_start_phy and io_tlb_end_phy, could we get same results
> > with less hunks?
> > Hillf
> What do you mean by less hunks? Are you referring to the memory space?
As in less patch movements.
> If so, then the patches I am submitting do not impact how much space is
> used for the bounce buffer. The only real result of these patches is
> that the total code path is significantly reduced since we don't have to
> perform any virtual to physical translations in the hot-path.
No. He is referring that you can keep io_tlb_end still here. Just
do the computation of the physical address in the init path (of the end).
Then you don't need to do the shifting in the 'is-this-swiotlb-buffer'
and can just do a simple:
if (dma_addr >= io_tlb_start && dma_addr <= io_tlb_end)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/