Skip to content

Commit d47be58

Browse files
anna-marialxKAGA-KOKO
authored andcommitted
timers/migration: Read childmask and parent pointer in a single place
Reading the childmask and parent pointer is required when propagating changes through the hierarchy. At the moment this reads are spread all over the place which makes it harder to follow. Move those reads to a single place to keep code clean. Signed-off-by: Anna-Maria Behnsen <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Frederic Weisbecker <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3ba1110 commit d47be58

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

kernel/time/timer_migration.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ static void __walk_groups(up_f up, struct tmigr_walk *data,
535535

536536
child = group;
537537
group = group->parent;
538+
data->childmask = child->childmask;
538539
} while (group);
539540
}
540541

@@ -647,9 +648,6 @@ static bool tmigr_active_up(struct tmigr_group *group,
647648

648649
trace_tmigr_group_set_cpu_active(group, newstate, childmask);
649650

650-
if (walk_done == false)
651-
data->childmask = group->childmask;
652-
653651
/*
654652
* The group is active (again). The group event might be still queued
655653
* into the parent group's timerqueue but can now be handled by the
@@ -1027,12 +1025,10 @@ static bool tmigr_handle_remote_up(struct tmigr_group *group,
10271025
}
10281026

10291027
/*
1030-
* Update of childmask for the next level and keep track of the expiry
1031-
* of the first event that needs to be handled (group->next_expiry was
1032-
* updated by tmigr_next_expired_groupevt(), next was set by
1033-
* tmigr_handle_remote_cpu()).
1028+
* Keep track of the expiry of the first event that needs to be handled
1029+
* (group->next_expiry was updated by tmigr_next_expired_groupevt(),
1030+
* next was set by tmigr_handle_remote_cpu()).
10341031
*/
1035-
data->childmask = group->childmask;
10361032
data->firstexp = group->next_expiry;
10371033

10381034
raw_spin_unlock_irq(&group->lock);
@@ -1110,7 +1106,7 @@ static bool tmigr_requires_handle_remote_up(struct tmigr_group *group,
11101106
* group before reading the next_expiry value.
11111107
*/
11121108
if (group->parent && !data->tmc_active)
1113-
goto out;
1109+
return false;
11141110

11151111
/*
11161112
* The lock is required on 32bit architectures to read the variable
@@ -1135,9 +1131,6 @@ static bool tmigr_requires_handle_remote_up(struct tmigr_group *group,
11351131
raw_spin_unlock(&group->lock);
11361132
}
11371133

1138-
out:
1139-
/* Update of childmask for the next level */
1140-
data->childmask = group->childmask;
11411134
return false;
11421135
}
11431136

@@ -1309,9 +1302,6 @@ static bool tmigr_inactive_up(struct tmigr_group *group,
13091302
/* Event Handling */
13101303
tmigr_update_events(group, child, data);
13111304

1312-
if (walk_done == false)
1313-
data->childmask = group->childmask;
1314-
13151305
return walk_done;
13161306
}
13171307

0 commit comments

Comments
 (0)