diff options
Diffstat (limited to 'include/linux/sched/mm.h')
-rw-r--r-- | include/linux/sched/mm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index 8557ec664213..1fc2e80f58af 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -48,6 +48,18 @@ static inline void mmdrop(struct mm_struct *mm) if (unlikely(atomic_dec_and_test(&mm->mm_count))) __mmdrop(mm); } +void mmdrop(struct mm_struct *mm); + +#ifdef CONFIG_PREEMPT_RT_BASE +extern void __mmdrop_delayed(struct rcu_head *rhp); +static inline void mmdrop_delayed(struct mm_struct *mm) +{ + if (atomic_dec_and_test(&mm->mm_count)) + call_rcu(&mm->delayed_drop, __mmdrop_delayed); +} +#else +# define mmdrop_delayed(mm) mmdrop(mm) +#endif /* * This has to be called after a get_task_mm()/mmget_not_zero() |