From: Martin Schwidefsky Date: Tue, 23 Sep 2014 12:01:34 +0000 (+0200) Subject: s390/mm: add NUMA balancing primitives X-Git-Tag: firefly_0821_release~176^2~1215^2~32 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b54565b86824ecc9f0ad5d0ee69696f38edc50fd;p=firefly-linux-kernel-4.4.55.git s390/mm: add NUMA balancing primitives Define pte_protnone and pmd_protnone for NUMA memory migration. Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index f66d82798a6a..bdb2f51124ed 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -576,6 +576,19 @@ static inline int pte_same(pte_t a, pte_t b) return pte_val(a) == pte_val(b); } +#ifdef CONFIG_NUMA_BALANCING +static inline int pte_protnone(pte_t pte) +{ + return pte_present(pte) && !(pte_val(pte) & _PAGE_READ); +} + +static inline int pmd_protnone(pmd_t pmd) +{ + /* pmd_large(pmd) implies pmd_present(pmd) */ + return pmd_large(pmd) && !(pmd_val(pmd) & _SEGMENT_ENTRY_READ); +} +#endif + static inline pgste_t pgste_get_lock(pte_t *ptep) { unsigned long new = 0;