Commit d47be589 authored by Anna-Maria Behnsen's avatar Anna-Maria Behnsen Committed by Thomas Gleixner

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: default avatarAnna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20240716-tmigr-fixes-v4-5-757baa7803fe@linutronix.de
parent 3ba11103
...@@ -535,6 +535,7 @@ static void __walk_groups(up_f up, struct tmigr_walk *data, ...@@ -535,6 +535,7 @@ static void __walk_groups(up_f up, struct tmigr_walk *data,
child = group; child = group;
group = group->parent; group = group->parent;
data->childmask = child->childmask;
} while (group); } while (group);
} }
...@@ -647,9 +648,6 @@ static bool tmigr_active_up(struct tmigr_group *group, ...@@ -647,9 +648,6 @@ static bool tmigr_active_up(struct tmigr_group *group,
trace_tmigr_group_set_cpu_active(group, newstate, childmask); trace_tmigr_group_set_cpu_active(group, newstate, childmask);
if (walk_done == false)
data->childmask = group->childmask;
/* /*
* The group is active (again). The group event might be still queued * The group is active (again). The group event might be still queued
* into the parent group's timerqueue but can now be handled by the * 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, ...@@ -1027,12 +1025,10 @@ static bool tmigr_handle_remote_up(struct tmigr_group *group,
} }
/* /*
* Update of childmask for the next level and keep track of the expiry * Keep track of the expiry of the first event that needs to be handled
* of the first event that needs to be handled (group->next_expiry was * (group->next_expiry was updated by tmigr_next_expired_groupevt(),
* updated by tmigr_next_expired_groupevt(), next was set by * next was set by tmigr_handle_remote_cpu()).
* tmigr_handle_remote_cpu()).
*/ */
data->childmask = group->childmask;
data->firstexp = group->next_expiry; data->firstexp = group->next_expiry;
raw_spin_unlock_irq(&group->lock); raw_spin_unlock_irq(&group->lock);
...@@ -1110,7 +1106,7 @@ static bool tmigr_requires_handle_remote_up(struct tmigr_group *group, ...@@ -1110,7 +1106,7 @@ static bool tmigr_requires_handle_remote_up(struct tmigr_group *group,
* group before reading the next_expiry value. * group before reading the next_expiry value.
*/ */
if (group->parent && !data->tmc_active) if (group->parent && !data->tmc_active)
goto out; return false;
/* /*
* The lock is required on 32bit architectures to read the variable * 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, ...@@ -1135,9 +1131,6 @@ static bool tmigr_requires_handle_remote_up(struct tmigr_group *group,
raw_spin_unlock(&group->lock); raw_spin_unlock(&group->lock);
} }
out:
/* Update of childmask for the next level */
data->childmask = group->childmask;
return false; return false;
} }
...@@ -1309,9 +1302,6 @@ static bool tmigr_inactive_up(struct tmigr_group *group, ...@@ -1309,9 +1302,6 @@ static bool tmigr_inactive_up(struct tmigr_group *group,
/* Event Handling */ /* Event Handling */
tmigr_update_events(group, child, data); tmigr_update_events(group, child, data);
if (walk_done == false)
data->childmask = group->childmask;
return walk_done; return walk_done;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment