Skip to content

Commit

Permalink
timers/migration: Simplify top level detection on group setup
Browse files Browse the repository at this point in the history
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@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250114231507.21672-5-frederic@kernel.org
  • Loading branch information
Frederic Weisbecker authored and Thomas Gleixner committed Jan 16, 2025
1 parent 3ec9557 commit dcf6230
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/time/timer_migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1624,9 +1624,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);
Expand Down

0 comments on commit dcf6230

Please sign in to comment.