mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Anna-Maria Behnsen" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Anna-Maria Behnsen" <anna-maria@linutronix.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/urgent] timers/migration: Read childmask and parent pointer in a single place
Date: Fri, 19 Jul 2024 18:06:11 -0000	[thread overview]
Message-ID: <172141237192.2215.3980137557769778526.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240716-tmigr-fixes-v4-5-757baa7803fe@linutronix.de>

The following commit has been merged into the timers/urgent branch of tip:

Commit-ID:     c9b3f0871f535e0ccbe34e5e7a15567e73bec806
Gitweb:        https://git.kernel.org/tip/c9b3f0871f535e0ccbe34e5e7a15567e73bec806
Author:        Anna-Maria Behnsen <anna-maria@linutronix.de>
AuthorDate:    Tue, 16 Jul 2024 16:19:23 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 19 Jul 2024 19:58:01 +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@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20240716-tmigr-fixes-v4-5-757baa7803fe@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 a32c8a7..6af1f21 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 = child->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;
 }
 

  parent reply	other threads:[~2024-07-19 18:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16 14:19 [PATCH v4 0/8] timers/migration: Fix three possible races and some improvements Anna-Maria Behnsen
2024-07-16 14:19 ` [PATCH v4 1/8] timers/migration: Do not rely always on group->parent Anna-Maria Behnsen
2024-07-19 18:06   ` [tip: timers/urgent] " tip-bot2 for Anna-Maria Behnsen
2024-07-22 19:35   ` tip-bot2 for Anna-Maria Behnsen
2024-07-16 14:19 ` [PATCH v4 2/8] timers/migration: Move hierarchy setup into cpuhotplug prepare callback Anna-Maria Behnsen
2024-07-16 23:01   ` Frederic Weisbecker
2024-07-17  9:49   ` [PATCH v5 " Anna-Maria Behnsen
2024-07-17 12:53     ` Frederic Weisbecker
2024-07-19 18:06     ` [tip: timers/urgent] " tip-bot2 for Anna-Maria Behnsen
2024-07-22 13:16       ` Frederic Weisbecker
2024-07-24 10:22         ` Borislav Petkov
2024-07-22 19:35     ` tip-bot2 for Anna-Maria Behnsen
2024-07-16 14:19 ` [PATCH v4 3/8] timers/migration: Improve tracing Anna-Maria Behnsen
2024-07-19 18:06   ` [tip: timers/urgent] " tip-bot2 for Anna-Maria Behnsen
2024-07-22 19:35   ` tip-bot2 for Anna-Maria Behnsen
2024-07-16 14:19 ` [PATCH v4 4/8] timers/migration: Use a single struct for hierarchy walk data Anna-Maria Behnsen
2024-07-19 18:06   ` [tip: timers/urgent] " tip-bot2 for Anna-Maria Behnsen
2024-07-22 19:35   ` tip-bot2 for Anna-Maria Behnsen
2024-07-16 14:19 ` [PATCH v4 5/8] timers/migration: Read childmask and parent pointer in a single place Anna-Maria Behnsen
2024-07-16 23:05   ` Frederic Weisbecker
2024-07-19 18:06   ` tip-bot2 for Anna-Maria Behnsen [this message]
2024-07-22 19:35   ` [tip: timers/urgent] " tip-bot2 for Anna-Maria Behnsen
2024-07-16 14:19 ` [PATCH v4 6/8] timers/migration: Rename childmask by groupmask to make naming more obvious Anna-Maria Behnsen
2024-07-16 23:10   ` Frederic Weisbecker
2024-07-19 18:06   ` [tip: timers/urgent] " tip-bot2 for Anna-Maria Behnsen
2024-07-22 19:35   ` tip-bot2 for Anna-Maria Behnsen
2024-07-16 14:19 ` [PATCH v4 7/8] timers/migration: Spare write when nothing changed Anna-Maria Behnsen
2024-07-19 18:06   ` [tip: timers/urgent] " tip-bot2 for Anna-Maria Behnsen
2024-07-22 19:35   ` tip-bot2 for Anna-Maria Behnsen
2024-07-16 14:19 ` [PATCH v4 8/8] timers/migration: Fix grammar in comment Anna-Maria Behnsen
2024-07-19 18:06   ` [tip: timers/urgent] " tip-bot2 for Anna-Maria Behnsen
2024-07-22 19:35   ` tip-bot2 for Anna-Maria Behnsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=172141237192.2215.3980137557769778526.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®