From nobody Wed Dec 17 17:24:16 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 989DB19B5AF for ; Tue, 16 Jul 2024 14:20:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721139607; cv=none; b=ovlkzTUjcHZ3FqT0tqNC2zNgJbgzC3zaibe0UJE210y6UYjne/1UgOhy/Kmu/w81L6l7amd21foxKzUnxfvO09XbhDtlHchshKcy2yCJSv0Yn9mZ1h600bo2NIg/c0YXtJahsX5bjL88wQjRp/scO2Zkp81QmCBXLMLCtRgSM/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721139607; c=relaxed/simple; bh=OpM2KuSJIW5rOw3rC8SFNnH6l7hunxKEVDqLGpHkC7Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ATgqK+al0f/M+iWa8LO5Qluc0wvEveMZn4hZnNiFPbwrCjDJr0/3snqYY5UyuRHxin23gOqU8h9/XTpa1rEy4kNl9PW/Mwr1Vk7lv2pw/j/ScCsMyogQu0hOyyGNExvZ/b0ynRFatXQfC4UsluHZbCUyKmmAHubmmbbM0lDyfX4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=BRN5Pwol; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Mea1wI7E; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BRN5Pwol"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Mea1wI7E" From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1721139599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eJwImKVD06i2BD4sac+Dv+NDLFI+BDAzv/wiUneFEYc=; b=BRN5Pwol9gHP3WVHDZ/sQEhVaFYRmiOoz9yfOHARd2IzbJXg+s5ksd10HVrYqnTsZzwTZY 5doIyQTEEAuY5NjZ7DIXcATwcrcJseC5honqnR6GpeENtrCJpUXF1/isF8layDzWG7Em+R /QDOgqCB9TYe0WdkHWVUVjI+/qE3zZB4fCP90f85RO65qcJRf/q8CdOD9mTkoK4FwyHpe/ wiwL2bmbwEfOi/tIYQdsFQQi1VzotmlUIi8bt1epI3rj8AKaK/dvZSuFH0a8K54TS8+PiO oXF9lnsPiviwhvkEQVkY+jlG6yLpypX8LWNlnPZcrfBk6GVGFagI+lZ0PLCa8g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1721139599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eJwImKVD06i2BD4sac+Dv+NDLFI+BDAzv/wiUneFEYc=; b=Mea1wI7EGd90Qi+hPZZBaUfYmx6Pj9YRKMFDl5wS2KMZS4e55b88Cmy5PEbNPivqho753M 0jZbrG5mWTyj8hBg== Date: Tue, 16 Jul 2024 16:19:23 +0200 Subject: [PATCH v4 5/8] timers/migration: Read childmask and parent pointer in a single place Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240716-tmigr-fixes-v4-5-757baa7803fe@linutronix.de> References: <20240716-tmigr-fixes-v4-0-757baa7803fe@linutronix.de> In-Reply-To: <20240716-tmigr-fixes-v4-0-757baa7803fe@linutronix.de> To: Frederic Weisbecker , Thomas Gleixner , linux-kernel@vger.kernel.org Cc: Anna-Maria Behnsen 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 Reviewed-by: Frederic Weisbecker --- 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 3458ee047027..af9c520bf3de 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 *d= ata, =20 child =3D group; group =3D group->parent; + data->childmask =3D child->childmask; } while (group); } =20 @@ -647,9 +648,6 @@ static bool tmigr_active_up(struct tmigr_group *group, =20 trace_tmigr_group_set_cpu_active(group, newstate, childmask); =20 - if (walk_done =3D=3D false) - data->childmask =3D 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 @@ static bool tmigr_handle_remote_up(struct tmigr_gro= up *group, } =20 /* - * 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 =3D group->childmask; data->firstexp =3D group->next_expiry; =20 raw_spin_unlock_irq(&group->lock); @@ -1110,7 +1106,7 @@ static bool tmigr_requires_handle_remote_up(struct tm= igr_group *group, * group before reading the next_expiry value. */ if (group->parent && !data->tmc_active) - goto out; + return false; =20 /* * The lock is required on 32bit architectures to read the variable @@ -1135,9 +1131,6 @@ static bool tmigr_requires_handle_remote_up(struct tm= igr_group *group, raw_spin_unlock(&group->lock); } =20 -out: - /* Update of childmask for the next level */ - data->childmask =3D group->childmask; return false; } =20 @@ -1309,9 +1302,6 @@ static bool tmigr_inactive_up(struct tmigr_group *gro= up, /* Event Handling */ tmigr_update_events(group, child, data); =20 - if (walk_done =3D=3D false) - data->childmask =3D group->childmask; - return walk_done; } =20 --=20 2.39.2