Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched: drop sched.h dependency on cpumask

sched.h needs cpumask.h mostly for types declaration. Now that we have
cpumask_types.h, which is a significantly smaller header, we can rely on
it.

The only exception is UP stub for set_cpus_allowed_ptr(). The function
needs to test bit #0 in a @new_mask, which can be trivially opencoded.

Link: https://lkml.kernel.org/r/20240528005648.182376-5-yury.norov@gmail.com
Signed-off-by: Yury Norov <yury.norov@gmail.com>
Cc: Amit Daniel Kachhap <amit.kachhap@gmail.com>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>
Cc: Christoph Lameter <cl@linux.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Yury Norov <yury.norov@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Yury Norov and committed by
Andrew Morton
361c1f04 eb4faa36

+3 -2
+3 -2
include/linux/sched.h
··· 13 13 #include <asm/processor.h> 14 14 #include <linux/thread_info.h> 15 15 #include <linux/preempt.h> 16 - #include <linux/cpumask.h> 16 + #include <linux/cpumask_types.h> 17 17 18 18 #include <linux/cache.h> 19 19 #include <linux/irqflags_types.h> ··· 1778 1778 } 1779 1779 static inline int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask) 1780 1780 { 1781 - if (!cpumask_test_cpu(0, new_mask)) 1781 + /* Opencoded cpumask_test_cpu(0, new_mask) to avoid dependency on cpumask.h */ 1782 + if ((*cpumask_bits(new_mask) & 1) == 0) 1782 1783 return -EINVAL; 1783 1784 return 0; 1784 1785 }