[Top] [All Lists]

[PATCH] hugetlb: Fix clear_user_highpage arguments

To: Andrew Morton <>,,
Subject: [PATCH] hugetlb: Fix clear_user_highpage arguments
From: Ralf Baechle <>
Date: Fri, 28 Sep 2007 17:35:45 +0100
Original-recipient: rfc822;
User-agent: Mutt/1.5.14 (2007-02-12)
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.

Signed-off-by: Ralf Baechle <>

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 
        for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); i++) {
-               clear_user_highpage(page + i, addr);
+               clear_user_highpage(page + i, addr + i * PAGE_SIZE);

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