diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2011-08-11 13:31:31 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-10 00:18:40 (GMT) |
commit | 10e9aed2338e85748f227947969df7dd614a9301 (patch) | |
tree | 84e3637ca78172f598b729954c5a44ff338d899d /include/linux | |
parent | e2d5d7daf459acde7c718ba4f30bbb00a66c5c1d (diff) | |
download | linux-fsl-qoriq-10e9aed2338e85748f227947969df7dd614a9301.tar.xz |
mm: pagefault_disabled()
Wrap the test for pagefault_disabled() into a helper, this allows us
to remove the need for current->pagefault_disabled on !-rt kernels.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-3yy517m8zsi9fpsf14xfaqkw@git.kernel.org
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5f0c31c..85556ee 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -52,6 +52,7 @@ struct sched_param { #include <linux/llist.h> #include <linux/uidgid.h> #include <linux/gfp.h> +#include <linux/hardirq.h> #include <asm/processor.h> @@ -1249,7 +1250,9 @@ struct task_struct { /* mutex deadlock detection */ struct mutex_waiter *blocked_on; #endif +#ifdef CONFIG_PREEMPT_RT_FULL int pagefault_disabled; +#endif #ifdef CONFIG_TRACE_IRQFLAGS unsigned int irq_events; unsigned long hardirq_enable_ip; @@ -1435,6 +1438,17 @@ static inline void set_numabalancing_state(bool enabled) } #endif +#ifdef CONFIG_PREEMPT_RT_FULL +static inline bool cur_pf_disabled(void) { return current->pagefault_disabled; } +#else +static inline bool cur_pf_disabled(void) { return false; } +#endif + +static inline bool pagefault_disabled(void) +{ + return in_atomic() || cur_pf_disabled(); +} + static inline struct pid *task_pid(struct task_struct *task) { return task->pids[PIDTYPE_PID].pid; |