Skip to content

Commit d8bf77a

Browse files
tongtiangenpalmer-dabbelt
authored andcommitted
riscv/mm: add arch hook arch_clear_hugepage_flags
With the PG_arch_1 we keep track if the page's data cache is clean, architecture rely on this property to treat new pages as dirty with respect to the data cache and perform the flushing before mapping the pages into userspace. 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. Fixes: 9e953cd ("riscv: Introduce huge page support for 32/64bit kernel") Signed-off-by: Tong Tiangen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent d33deda commit d8bf77a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/riscv/include/asm/hugetlb.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
#include <asm-generic/hugetlb.h>
66
#include <asm/page.h>
77

8+
static inline void arch_clear_hugepage_flags(struct page *page)
9+
{
10+
clear_bit(PG_dcache_clean, &page->flags);
11+
}
12+
#define arch_clear_hugepage_flags arch_clear_hugepage_flags
13+
814
#endif /* _ASM_RISCV_HUGETLB_H */

0 commit comments

Comments
 (0)