public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hugetlb: Fix clear_user_highpage arguments
@ 2007-09-28 16:35 Ralf Baechle
  2007-09-28 18:45 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2007-09-28 16:35 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel, linux-mips

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 <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);
 	}
 }
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-28 19:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-28 16:35 [PATCH] hugetlb: Fix clear_user_highpage arguments Ralf Baechle
2007-09-28 18:45 ` Andrew Morton
2007-09-28 18:53   ` Ralf Baechle
2007-09-28 19:23     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox