diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 677c1fad155f..07f25e502078 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -580,10 +580,10 @@ struct mm_struct { struct file __rcu *exe_file; #ifdef CONFIG_MMU_NOTIFIER struct mmu_notifier_subscriptions *notifier_subscriptions; -#endif /* CONFIG_MMU_NOTIFIER */ #ifdef CONFIG_SPECULATIVE_PAGE_FAULT struct percpu_rw_semaphore *mmu_notifier_lock; #endif /* CONFIG_SPECULATIVE_PAGE_FAULT */ +#endif /* CONFIG_MMU_NOTIFIER */ #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS pgtable_t pmd_huge_pte; /* protected by page_table_lock */ #endif diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index ae04f83b4e37..d0430410fdd8 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -772,7 +772,7 @@ static inline void mmu_notifier_synchronize(void) #endif /* CONFIG_MMU_NOTIFIER */ -#if defined(CONFIG_SPECULATIVE_PAGE_FAULT) +#if defined(CONFIG_MMU_NOTIFIER) && defined(CONFIG_SPECULATIVE_PAGE_FAULT) static inline bool mmu_notifier_trylock(struct mm_struct *mm) {