Skip to contentSkip to conversation

sched-drop-schedh-dependency-on-cpumask.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Jun 25, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: sched: drop sched.h dependency on cpumask
has been removed from the -mm tree. Its filename was
sched-drop-schedh-dependency-on-cpumask.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Yury Norov <[email protected]>
Subject: sched: drop sched.h dependency on cpumask
Date: Mon, 27 May 2024 17:56:46 -0700

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.

Cc Amit Daniel Kachhap <[email protected]>
Cc Anna-Maria Behnsen <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Dennis Zhou <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Juri Lelli <[email protected]>
Cc Kees Cook <[email protected]>
Cc Mathieu Desnoyers <[email protected]>
Cc Paul E. McKenney <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
Cc Rasmus Villemoes <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ulf Hansson <[email protected]>
Cc Vincent Guittot <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Yury Norov <[email protected]>

---

 include/linux/sched.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/sched.h renamed from include/linux/sched.h~sched-drop-schedh-dependency-on-cpumask +3 -2
@@ -13,7 +13,7 @@
 #include <asm/processor.h>
 #include <linux/thread_info.h>
 #include <linux/preempt.h>
-#include <linux/cpumask.h>
+#include <linux/cpumask_types.h>
 
 #include <linux/cache.h>
 #include <linux/irqflags_types.h>
@@ -1778,7 +1778,8 @@ static inline void do_set_cpus_allowed(s
 }
 static inline int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
 {
-	if (!cpumask_test_cpu(0, new_mask))
+	/* Opencoded cpumask_test_cpu(0, new_mask) to avoid dependency on cpumask.h */
+	if ((*cpumask_bits(new_mask) & 1) == 0)
 		return -EINVAL;
 	return 0;
 }

_

Patches currently in -mm which might be from [email protected] are