[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <172011797394.2215.6645440287912174819.tip-bot2@tip-bot2>
Date: Thu, 04 Jul 2024 18:32:53 -0000
From: "tip-bot2 for Anna-Maria Behnsen" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Anna-Maria Behnsen" <anna-maria@...utronix.de>,
Thomas Gleixner <tglx@...utronix.de>,
Frederic Weisbecker <frederic@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: timers/core] timers/migration: Read childmask and parent
pointer in a single place
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 56f9a5fd69eae92d7051a228ee192452248a6bdc
Gitweb: https://git.kernel.org/tip/56f9a5fd69eae92d7051a228ee192452248a6bdc
Author: Anna-Maria Behnsen <anna-maria@...utronix.de>
AuthorDate: Mon, 01 Jul 2024 12:18:41 +02:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Thu, 04 Jul 2024 20:24:57 +02:00
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 <anna-maria@...utronix.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Frederic Weisbecker <frederic@...nel.org>
Link: https://lore.kernel.org/r/20240701-tmigr-fixes-v3-5-25cd5de318fb@linutronix.de
---
kernel/time/timer_migration.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/kernel/time/timer_migration.c b/kernel/time/timer_migration.c
index 39eb77e..1fb9305 100644
--- a/kernel/time/timer_migration.c
+++ b/kernel/time/timer_migration.c
@@ -535,6 +535,7 @@ static void __walk_groups(up_f up, struct tmigr_walk *data,
child = group;
group = group->parent;
+ data->childmask = group->childmask;
} while (group);
}
@@ -647,9 +648,6 @@ static bool tmigr_active_up(struct tmigr_group *group,
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
* into the parent group's timerqueue but can now be handled by the
@@ -1027,12 +1025,10 @@ again:
}
/*
- * Update of childmask for the next level and keep track of the expiry
- * of the first event that needs to be handled (group->next_expiry was
- * updated by tmigr_next_expired_groupevt(), next was set by
- * tmigr_handle_remote_cpu()).
+ * Keep track of the expiry of the first event that needs to be handled
+ * (group->next_expiry was updated by tmigr_next_expired_groupevt(),
+ * next was set by tmigr_handle_remote_cpu()).
*/
- data->childmask = group->childmask;
data->firstexp = group->next_expiry;
raw_spin_unlock_irq(&group->lock);
@@ -1110,7 +1106,7 @@ static bool tmigr_requires_handle_remote_up(struct tmigr_group *group,
* group before reading the next_expiry value.
*/
if (group->parent && !data->tmc_active)
- goto out;
+ return false;
/*
* 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,
raw_spin_unlock(&group->lock);
}
-out:
- /* Update of childmask for the next level */
- data->childmask = group->childmask;
return false;
}
@@ -1309,9 +1302,6 @@ static bool tmigr_inactive_up(struct tmigr_group *group,
/* Event Handling */
tmigr_update_events(group, child, data);
- if (walk_done == false)
- data->childmask = group->childmask;
-
return walk_done;
}
Powered by blists - more mailing lists