From: David Gibson Date: Tue, 7 Feb 2006 20:58:25 +0000 (-0800) Subject: [PATCH] Hugepages need clear_user_highpage() not clear_highpage() X-Git-Tag: v2.6.16-rc3~131 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a2dfef6947139db9b886fce510c4d0c913beb5f0;p=linux-2.6-omap-h63xx.git [PATCH] Hugepages need clear_user_highpage() not clear_highpage() When hugepages are newly allocated to a file in mm/hugetlb.c, we clear them with a call to clear_highpage() on each of the subpages. We should be using clear_user_highpage(): on powerpc, at least, clear_highpage() doesn't correctly mark the page as icache dirty so if the page is executed shortly after it's possible to get strange results. Signed-off-by: David Gibson Acked-by: William Lee Irwin III Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ceb3ebb3c39..3255ca420fc 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -107,7 +107,7 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr) set_page_count(page, 1); page[1].mapping = (void *)free_huge_page; for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i) - clear_highpage(&page[i]); + clear_user_highpage(&page[i], addr); return page; }