[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1249683952.4671.41.camel@david-laptop>
Date: Fri, 7 Aug 2009 15:25:52 -0700
From: "David Xiao" <dxiao@...adcom.com>
To: "Russell King - ARM Linux" <linux@....linux.org.uk>
cc: "Laurent Pinchart" <laurent.pinchart@...asonboard.com>,
"Robin Holt" <holt@....com>,
"Laurent Desnogues" <laurent.desnogues@...il.com>,
"Jamie Lokier" <jamie@...reable.org>,
"Ben Dooks" <ben-linux@...ff.org>,
"Hugh Dickins" <hugh.dickins@...cali.co.uk>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
v4l2_linux <linux-media@...r.kernel.org>,
"linux-arm-kernel@...ts.arm.linux.org.uk"
<linux-arm-kernel@...ts.arm.linux.org.uk>
Subject: Re: How to efficiently handle DMA and cache on ARMv7 ? (was
"Is get_user_pages() enough to prevent pages from being swapped out ?")
On Fri, 2009-08-07 at 13:28 -0700, Russell King - ARM Linux wrote:
> The kernel direct mapping maps all system (low) memory with normal
> memory cacheable attributes.
>
> So using vmalloc, dma_alloc_coherent, using pages in userspace all
> create duplicate mappings of pages.
>
If we do want to remove all these duplicate mappings, as part of
solution to deal with the speculative prefetching, probably one way is
to not map all the RAM into the direct-mapped space at paging_init()
time, and instead map them on-demand by different upper layer allocation
functions, such as vmalloc/dma_alloc_coherent/do_brk/kmalloc/
get_free_pages/etc. But then the distinction between upper layer
allocation functions and non-upper layer ones must be made clear though.
I know that mapping the RAM at paging_init() time can take advantage of
1M section mapping most of the time, and thus save many 1KB L2 page
tables. But a lot of memory still ends up being remapped with L2 page
tables later on, and meanwhile 1KB might not be as "precious" as it used
to be as well-:)
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists