From: Liam R. Howlett Date: Fri, 28 Aug 2020 19:32:05 +0000 (-0400) Subject: sched/mm and kernel/fork: Add maple tree rcu enable/disable X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5b9c1bb62e99841b119e88d9b0eb261c63773de3;p=users%2Fjedix%2Flinux-maple.git sched/mm and kernel/fork: Add maple tree rcu enable/disable Signed-off-by: Liam R. Howlett --- diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index d5ece7a9a403f..919e2e44b764e 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -8,6 +8,7 @@ #include #include #include +#include /* * Routines for handling mm_structs @@ -67,11 +68,13 @@ static inline void mmdrop(struct mm_struct *mm) */ static inline void mmget(struct mm_struct *mm) { + mt_set_in_rcu(&mm->mm_mt); atomic_inc(&mm->mm_users); } static inline bool mmget_not_zero(struct mm_struct *mm) { + mt_set_in_rcu(&mm->mm_mt); return atomic_inc_not_zero(&mm->mm_users); } diff --git a/kernel/fork.c b/kernel/fork.c index 8fd147e1e7e73..4811feef06b32 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1095,6 +1095,7 @@ static inline void __mmput(struct mm_struct *mm) } if (mm->binfmt) module_put(mm->binfmt->module); + mt_clear_in_rcu(&mm->mm_mt); mmdrop(mm); }