Skip to contentSkip to conversation

sched-avoid-using-ilog2-in-schedh.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: avoid using ilog2() in sched.h
has been removed from the -mm tree. Its filename was
sched-avoid-using-ilog2-in-schedh.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: avoid using ilog2() in sched.h
Date: Mon, 27 May 2024 17:56:44 -0700

<linux/sched.h> indirectly via cpumask.h path includes the ilog2.h header to calculate ilog2(TASK_REPORT_MAX). The following patches drops sched.h dependency on cpumask.h, and to have a successful build, the header has to be included explicitly.

sched.h is a frequently included header, and it's better to keep the dependency list as small as possible. So, instead of including ilog2.h for a single BUILD_BUG_ON() check, the same check may be implemented by taking exponent of the other part of equation.

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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/sched.h renamed from include/linux/sched.h~sched-avoid-using-ilog2-in-schedh +1 -1
@@ -1604,7 +1604,7 @@ static inline char task_index_to_char(un
 {
 	static const char state_char[] = "RSDTtXZPI";
 
-	BUILD_BUG_ON(1 + ilog2(TASK_REPORT_MAX) != sizeof(state_char) - 1);
+	BUILD_BUG_ON(TASK_REPORT_MAX * 2 != 1 << (sizeof(state_char) - 1));
 
 	return state_char[state];
 }

_

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