[PATCH 1/2] arm: mm: fix dcache flush logic for compound high pages

Will Deacon will.deacon at arm.com
Fri Dec 13 11:38:21 EST 2013


On Fri, Dec 13, 2013 at 12:06:30PM +0000, Steve Capper wrote:
> When given a compound high page, __flush_dcache_page will only flush
> the first page of the compound page repeatedly rather than the entire
> set of constituent pages.
> 
> This patch corrects the logic such that all constituent pages are now
> flushed.

Ha -- well spotted!

> Signed-off-by: Steve Capper <steve.capper at linaro.org>
> ---
>  arch/arm/mm/flush.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
> index 6d5ba9a..4962302 100644
> --- a/arch/arm/mm/flush.c
> +++ b/arch/arm/mm/flush.c
> @@ -173,18 +173,19 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page)
>  		__cpuc_flush_dcache_area(page_address(page), page_size);
>  	} else {
>  		unsigned long i;
> +		struct page *cpage = page;
>  		if (cache_is_vipt_nonaliasing()) {
> -			for (i = 0; i < (1 << compound_order(page)); i++) {
> -				void *addr = kmap_atomic(page);
> +			for (i = 0; i < (1 << compound_order(page)); cpage++, i++) {
> +				void *addr = kmap_atomic(cpage);

Any reason not to use page + i?

Will



More information about the linux-arm-kernel mailing list