diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-06-06 10:20:33 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2015-02-13 22:20:32 (GMT) |
commit | a2dc3dc8baee709966e36929b6fbd1cb141cdc0a (patch) | |
tree | 2b8fb288ca53ac67e0c67b55afb50d0a3ad1e791 /include | |
parent | 7cb4692689e70d12daa08b31634f29107020d0a1 (diff) | |
download | linux-fsl-qoriq-a2dc3dc8baee709966e36929b6fbd1cb141cdc0a.tar.xz |
sched-mmdrop-delayed.patch
Needs thread context (pgd_lock) -> ifdeffed. workqueues wont work with
RT
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm_types.h | 4 | ||||
-rw-r--r-- | include/linux/sched.h | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 5c9aa9c..a9c83ee 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -11,6 +11,7 @@ #include <linux/completion.h> #include <linux/cpumask.h> #include <linux/page-debug-flags.h> +#include <linux/rcupdate.h> #include <linux/uprobes.h> #include <linux/page-flags-layout.h> #include <asm/page.h> @@ -448,6 +449,9 @@ struct mm_struct { bool tlb_flush_pending; #endif struct uprobes_state uprobes_state; +#ifdef CONFIG_PREEMPT_RT_BASE + struct rcu_head delayed_drop; +#endif }; /* first nid will either be a valid NID or one of these values */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 4d7ffbd..449aac7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2158,12 +2158,24 @@ extern struct mm_struct * mm_alloc(void); /* mmdrop drops the mm and the page tables */ extern void __mmdrop(struct mm_struct *); + static inline void mmdrop(struct mm_struct * mm) { if (unlikely(atomic_dec_and_test(&mm->mm_count))) __mmdrop(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 + /* mmput gets rid of the mappings and all user-space */ extern void mmput(struct mm_struct *); /* Grab a reference to a task's mm, if it is not already going away */ |