public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Anna-Maria Behnsen <anna-maria@linutronix.de>
Subject: [PATCH 01/10] clockevents: Improve clockevents_notify_released() comment
Date: Thu, 17 Oct 2024 18:50:32 +0200	[thread overview]
Message-ID: <20241017165041.6954-2-frederic@kernel.org> (raw)
In-Reply-To: <20241017165041.6954-1-frederic@kernel.org>

When a new clockevent device is added and replaces a previous device,
the latter is put into the released list. Then the released list is
added back.

This may look counter-intuitive but the reason is that released device
might be suitable for other uses. For example a released CPU regular
clockevent can be a better replacement for the current broadcast event.
Similarly a released broadcast clockevent can be a better replacement
for the current regular clockevent of a given CPU.

Improve comments stating about these subtleties.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 kernel/time/clockevents.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 78c7bd64d0dd..4af27994db93 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -337,13 +337,21 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
 }
 
 /*
- * Called after a notify add to make devices available which were
- * released from the notifier call.
+ * Called after a clockevent has been added which might
+ * have replaced a current regular or broadcast device. A
+ * released normal device might be a suitable replacement
+ * for the current broadcast device. Similarly a released
+ * broadcast device might be a suitable replacement for a
+ * normal device.
  */
 static void clockevents_notify_released(void)
 {
 	struct clock_event_device *dev;
 
+	/*
+	 * Keep iterating as long as tick_check_new_device()
+	 * replaces a device.
+	 */
 	while (!list_empty(&clockevents_released)) {
 		dev = list_entry(clockevents_released.next,
 				 struct clock_event_device, list);
-- 
2.46.0


  reply	other threads:[~2024-10-17 16:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 16:50 [PATCH 00/10] clockevents: Rearrange cpuhotplug operations Frederic Weisbecker
2024-10-17 16:50 ` Frederic Weisbecker [this message]
2024-10-17 16:50 ` [PATCH 02/10] clockevents: Shutdown and unregister current clockevents at CPUHP_AP_TICK_DYING Frederic Weisbecker
2024-10-21  5:00   ` kernel test robot
2024-10-17 16:50 ` [PATCH 03/10] tick: Remove now unneeded low-res tick stop on CPUHP_AP_TICK_DYING Frederic Weisbecker
2024-10-17 16:50 ` [PATCH 04/10] arm/twd: Remove clockevents shutdown call on offlining Frederic Weisbecker
2024-10-17 16:50 ` [PATCH 05/10] clocksource/drivers/arm_arch_timer: " Frederic Weisbecker
2024-10-17 16:50 ` [PATCH 06/10] clocksource/driver/arm_global_timer: " Frederic Weisbecker
2024-10-17 16:50 ` [PATCH 07/10] drivers/clocksource/exynos_mct: " Frederic Weisbecker
2024-10-17 16:50 ` [PATCH 08/10] clocksource/drivers/armada-370-xp: " Frederic Weisbecker
2024-10-17 16:50 ` [PATCH 09/10] clocksource/drivers/qcom: " Frederic Weisbecker
2024-10-17 16:50 ` [PATCH 10/10] drivers/clocksource/timer-tegra: " Frederic Weisbecker
2024-10-24  8:34 ` [PATCH 00/10] clockevents: Rearrange cpuhotplug operations Thomas Gleixner
2024-10-29 12:35   ` Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2024-10-29 12:54 [PATCH 00/10] clockevents: Rearrange cpuhotplug operations v2 Frederic Weisbecker
2024-10-29 12:54 ` [PATCH 01/10] clockevents: Improve clockevents_notify_released() comment Frederic Weisbecker

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=20241017165041.6954-2-frederic@kernel.org \
    --to=frederic@kernel.org \
    --cc=anna-maria@linutronix.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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