aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2021-07-30 12:24:36 +0100
committerPeter Zijlstra <peterz@infradead.org>2021-08-20 12:33:00 +0200
commit234b8ab6476c5edd5262e2ff563de9498d60044a (patch)
tree0aef76cf961a22e3f622d17824cc532745609604 /include/linux/sched.h
parentsched: Allow task CPU affinity to be restricted on asymmetric systems (diff)
downloadlinux-dev-234b8ab6476c5edd5262e2ff563de9498d60044a.tar.xz
linux-dev-234b8ab6476c5edd5262e2ff563de9498d60044a.zip
sched: Introduce dl_task_check_affinity() to check proposed affinity
In preparation for restricting the affinity of a task during execve() on arm64, introduce a new dl_task_check_affinity() helper function to give an indication as to whether the restricted mask is admissible for a deadline task. Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com> Link: https://lore.kernel.org/r/20210730112443.23245-10-will@kernel.org
Diffstat (limited to '')
-rw-r--r--include/linux/sched.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ce2d5cfc331e..3bb9fecfdaa1 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1709,6 +1709,7 @@ extern void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new
extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask);
extern int dup_user_cpus_ptr(struct task_struct *dst, struct task_struct *src, int node);
extern void release_user_cpus_ptr(struct task_struct *p);
+extern int dl_task_check_affinity(struct task_struct *p, const struct cpumask *mask);
extern void force_compatible_cpus_allowed_ptr(struct task_struct *p);
extern void relax_compatible_cpus_allowed_ptr(struct task_struct *p);
#else
@@ -1731,6 +1732,11 @@ static inline void release_user_cpus_ptr(struct task_struct *p)
{
WARN_ON(p->user_cpus_ptr);
}
+
+static inline int dl_task_check_affinity(struct task_struct *p, const struct cpumask *mask)
+{
+ return 0;
+}
#endif
extern int yield_to(struct task_struct *p, bool preempt);