]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sparc: add pmd_[dirty|mkclean] for THP
authorMinchan Kim <minchan@kernel.org>
Tue, 7 Apr 2015 23:44:40 +0000 (09:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 7 Apr 2015 23:44:40 +0000 (09:44 +1000)
MADV_FREE needs pmd_dirty and pmd_mkclean for detecting recent overwrite
of the contents since MADV_FREE syscall is called for THP page.

This patch adds pmd_dirty and pmd_mkclean for THP page MADV_FREE
support.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/sparc/include/asm/pgtable_64.h

index dc165ebdf05aef6086bf5d5c5b1dd3a85f686648..d839a46aa694a88aaa61f4988bc59648cafa4476 100644 (file)
@@ -647,6 +647,13 @@ static inline unsigned long pmd_young(pmd_t pmd)
        return pte_young(pte);
 }
 
+static inline int pmd_dirty(pmd_t pmd)
+{
+       pte_t pte = __pte(pmd_val(pmd));
+
+       return pte_dirty(pte);
+}
+
 static inline unsigned long pmd_write(pmd_t pmd)
 {
        pte_t pte = __pte(pmd_val(pmd));
@@ -697,6 +704,15 @@ static inline pmd_t pmd_mkdirty(pmd_t pmd)
        return __pmd(pte_val(pte));
 }
 
+static inline pmd_t pmd_mkclean(pmd_t pmd)
+{
+       pte_t pte = __pte(pmd_val(pmd));
+
+       pte = pte_mkclean(pte);
+
+       return __pmd(pte_val(pte));
+}
+
 static inline pmd_t pmd_mkyoung(pmd_t pmd)
 {
        pte_t pte = __pte(pmd_val(pmd));