aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/hugetlb.h
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2012-10-08 19:29:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-09 03:22:24 -0400
commit5d3a551c28c6669dc43be40d8fafafbc2ec8f42b (patch)
treeb3a9608ca6ab208d2c08e4fb4978037fe805764e /arch/sh/include/asm/hugetlb.h
parent01dc52ebdf472f77cca623ca693ca24cfc0f1bbe (diff)
mm: hugetlb: add arch hook for clearing page flags before entering pool
The core page allocator ensures that page flags are zeroed when freeing pages via free_pages_check. A number of architectures (ARM, PPC, MIPS) rely on this property to treat new pages as dirty with respect to the data cache and perform the appropriate flushing before mapping the pages into userspace. This can lead to cache synchronisation problems when using hugepages, since the allocator keeps its own pool of pages above the usual page allocator and does not reset the page flags when freeing a page into the pool. This patch adds a new architecture hook, arch_clear_hugepage_flags, so that architectures which rely on the page flags being in a particular state for fresh allocations can adjust the flags accordingly when a page is freed into the pool. Signed-off-by: Will Deacon <will.deacon@arm.com> Cc: Michal Hocko <mhocko@suse.cz> Reviewed-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sh/include/asm/hugetlb.h')
-rw-r--r--arch/sh/include/asm/hugetlb.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h
index 967068fb79ac..b3808c7d67b2 100644
--- a/arch/sh/include/asm/hugetlb.h
+++ b/arch/sh/include/asm/hugetlb.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_SH_HUGETLB_H 1#ifndef _ASM_SH_HUGETLB_H
2#define _ASM_SH_HUGETLB_H 2#define _ASM_SH_HUGETLB_H
3 3
4#include <asm/cacheflush.h>
4#include <asm/page.h> 5#include <asm/page.h>
5 6
6 7
@@ -89,4 +90,9 @@ static inline void arch_release_hugepage(struct page *page)
89{ 90{
90} 91}
91 92
93static inline void arch_clear_hugepage_flags(struct page *page)
94{
95 clear_bit(PG_dcache_clean, &page->flags);
96}
97
92#endif /* _ASM_SH_HUGETLB_H */ 98#endif /* _ASM_SH_HUGETLB_H */