Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2013 21:16:23 +0100
From:      Olivier Houchard <mlfbsd@ci0.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        arm@freebsd.org
Subject:   Re: bud_dmamap_load_buffer()
Message-ID:  <20130131201623.GA58163@ci0.org>
In-Reply-To: <20130131192426.GL2522@kib.kiev.ua>
References:  <20130131192426.GL2522@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 31, 2013 at 09:24:27PM +0200, Konstantin Belousov wrote:
> I noted that arm/busdma_machdep.c uses essentially inlined pmap_kextract()
> to get the physical address from the kernel address.  I consulted with
> gonzo, who said that he does not see a reason for inlining the code.
> 
> My theory is that before r240983, pmap_kextract() locked the pmap, which
> caused unneeded and probably wrong locking in the busdma load path. Since
> this issue is fixed, I see no reason for directly walking the page tables.
> 
> Could somebody please review and test the patch ? v6 busdma already uses
> pmap_kextract().
> 
> Do not remove me from Cc:.

Hi Konstantin,

It's that way for historical reasons. It used to check the caching attributes
of the page, as well as its physical address, to try hard to avoid doing
unnecessery cache flush if the page is already mapped as uncache. Now that
code is long gone, and there's no reason anymore not to just use
pmap_kextract(). Your patch looks fine to me.

Regards,

Olivier



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130131201623.GA58163>