[PATCH v2 6.12.y 3/7] timers/migration: Simplify top level detection on group setup
From: Ionut Nechita (Wind River)
Date: Sat Mar 21 2026 - 06:26:02 EST
From: Ionut Nechita <ionut.nechita@xxxxxxxxxxxxx>
From: Frederic Weisbecker <frederic@xxxxxxxxxx>
commit dcf6230555dcd0b05e8d2dd5b128dcc4b6fc04ef upstream.
Having a single group on a given level is enough to know this is the
top level, because a root has to have at least two children, unless that
root is the only group and the children are actual CPUs.
Simplify the test in tmigr_setup_groups() accordingly.
Signed-off-by: Frederic Weisbecker <frederic@xxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/all/20250114231507.21672-5-frederic@xxxxxxxxxx
---
kernel/time/timer_migration.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c
index 0707f1ef05f7e..2f6330831f084 100644
--- a/kernel/time/timer_migration.c
+++ b/kernel/time/timer_migration.c
@@ -1670,9 +1670,7 @@ static int tmigr_setup_groups(unsigned int cpu, unsigned int node)
* be different from tmigr_hierarchy_levels, contains only a
* single group.
*/
- if (group->parent || i == tmigr_hierarchy_levels ||
- (list_empty(&tmigr_level_list[i]) &&
- list_is_singular(&tmigr_level_list[i - 1])))
+ if (group->parent || list_is_singular(&tmigr_level_list[i - 1]))
break;
} while (i < tmigr_hierarchy_levels);
--
2.53.0