aboutsummaryrefslogtreecommitdiff
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 3e8b05e8fdf2..b409b9453844 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1263,7 +1263,9 @@ struct task_struct {
#endif
unsigned int policy;
+#ifdef CONFIG_PREEMPT_RT_FULL
int migrate_disable;
+#endif
cpumask_t cpus_allowed;
#ifdef CONFIG_PREEMPT_RCU
@@ -2693,11 +2695,22 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
#endif /* CONFIG_SMP */
+static inline int __migrate_disabled(struct task_struct *p)
+{
+#ifdef CONFIG_PREEMPT_RT_FULL
+ return p->migrate_disable;
+#else
+ return 0;
+#endif
+}
+
/* Future-safe accessor for struct task_struct's cpus_allowed. */
static inline const struct cpumask *tsk_cpus_allowed(struct task_struct *p)
{
+#ifdef CONFIG_PREEMPT_RT_FULL
if (p->migrate_disable)
return cpumask_of(task_cpu(p));
+#endif
return &p->cpus_allowed;
}