linux-mips
[Top] [All Lists]

Re: [PATCH] hugetlb: Fix clear_user_highpage arguments

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] hugetlb: Fix clear_user_highpage arguments
From: Andrew Morton <akpm@linux-foundation.org>
Date: Fri, 28 Sep 2007 11:45:26 -0700
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org
In-reply-to: <20070928163545.GA5933@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20070928163545.GA5933@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Fri, 28 Sep 2007 17:35:45 +0100 Ralf Baechle <ralf@linux-mips.org> wrote:

> The virtual address space argument of clear_user_highpage is supposed to
> be the virtual address where the page being cleared will eventually be
> mapped. This allows architectures with virtually indexed caches a few
> clever tricks.  That sort of trick falls over in painful ways if the
> virtual address argument is wrong.

yeah, but only if you're using a weird CPU architecture ;)

> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 84c795e..eab8c42 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -42,7 +42,7 @@ static void clear_huge_page(struct page *page, unsigned 
> long addr)
>       might_sleep();
>       for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); i++) {
>               cond_resched();
> -             clear_user_highpage(page + i, addr);
> +             clear_user_highpage(page + i, addr + i * PAGE_SIZE);
>       }
>  }
>  

I'll add this to the 2.6.23 queue.  Is it needed in 2.6.22.x?

<Prev in Thread] Current Thread [Next in Thread>