Skip to content

Commit

Permalink
timers/migration: Improve tracing
Browse files Browse the repository at this point in the history
Trace points of inactive and active propagation are located at the end of
the related functions. The interesting information of those trace points is
the updated group state. When trace points are not located directly at the
place where group state changed, order of trace points in traces could be
confusing.

Move inactive and active propagation trace points directly after update of
group state values.

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]
  • Loading branch information
anna-marialx authored and KAGA-KOKO committed Jul 22, 2024
1 parent 10a0e6f commit 9250674
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions kernel/time/timer_migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,8 @@ static bool tmigr_active_up(struct tmigr_group *group,

} while (!atomic_try_cmpxchg(&group->migr_state, &curstate.state, newstate.state));

trace_tmigr_group_set_cpu_active(group, newstate, childmask);

if (walk_done == false)
data->childmask = group->childmask;

Expand All @@ -673,8 +675,6 @@ static bool tmigr_active_up(struct tmigr_group *group,
*/
group->groupevt.ignore = true;

trace_tmigr_group_set_cpu_active(group, newstate, childmask);

return walk_done;
}

Expand Down Expand Up @@ -1306,9 +1306,10 @@ static bool tmigr_inactive_up(struct tmigr_group *group,

WARN_ON_ONCE((newstate.migrator != TMIGR_NONE) && !(newstate.active));

if (atomic_try_cmpxchg(&group->migr_state, &curstate.state,
newstate.state))
if (atomic_try_cmpxchg(&group->migr_state, &curstate.state, newstate.state)) {
trace_tmigr_group_set_cpu_inactive(group, newstate, childmask);
break;
}

/*
* The memory barrier is paired with the cmpxchg() in
Expand All @@ -1327,8 +1328,6 @@ static bool tmigr_inactive_up(struct tmigr_group *group,
if (walk_done == false)
data->childmask = group->childmask;

trace_tmigr_group_set_cpu_inactive(group, newstate, childmask);

return walk_done;
}

Expand Down

0 comments on commit 9250674

Please sign in to comment.