diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-06-16 11:26:08 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-10 00:19:14 (GMT) |
commit | 5f1a16bdb3b1bda23879ac0ff31739b3c255b03d (patch) | |
tree | 21c6d720ec90f88b3e0477a7c04e0ad5db9172ab /include/linux/sched.h | |
parent | f31b617a9cfe6498b9ebc27187fee5385c17e337 (diff) | |
download | linux-fsl-qoriq-5f1a16bdb3b1bda23879ac0ff31739b3c255b03d.tar.xz |
sched-migrate-disable.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index bf1cf6d..9861c9b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1063,6 +1063,7 @@ struct task_struct { #endif unsigned int policy; + int migrate_disable; int nr_cpus_allowed; cpumask_t cpus_allowed; @@ -1436,9 +1437,6 @@ struct task_struct { #endif }; -/* Future-safe accessor for struct task_struct's cpus_allowed. */ -#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) - #ifdef CONFIG_NUMA_BALANCING extern void task_numa_fault(int node, int pages, bool migrated); extern void set_numabalancing_state(bool enabled); @@ -2734,6 +2732,15 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) #endif /* CONFIG_SMP */ +/* Future-safe accessor for struct task_struct's cpus_allowed. */ +static inline const struct cpumask *tsk_cpus_allowed(struct task_struct *p) +{ + if (p->migrate_disable) + return cpumask_of(task_cpu(p)); + + return &p->cpus_allowed; +} + extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); extern long sched_getaffinity(pid_t pid, struct cpumask *mask); |