mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Frederic Weisbecker" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Frederic Weisbecker <frederic@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] clockevents: Improve clockevents_notify_released() comment
Date: Wed, 30 Oct 2024 20:13:36 -0000	[thread overview]
Message-ID: <173031921690.3137.8686198378080958241.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20241029125451.54574-2-frederic@kernel.org>

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

Commit-ID:     679f8484cafa08f49a19e2947d05e96321fbed9d
Gitweb:        https://git.kernel.org/tip/679f8484cafa08f49a19e2947d05e96321fbed9d
Author:        Frederic Weisbecker <frederic@kernel.org>
AuthorDate:    Tue, 29 Oct 2024 13:54:42 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Wed, 30 Oct 2024 21:02:21 +01:00

clockevents: Improve clockevents_notify_released() comment

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>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20241029125451.54574-2-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 78c7bd6..4af2799 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);

  reply	other threads:[~2024-10-30 20:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
2024-10-30 20:13   ` tip-bot2 for Frederic Weisbecker [this message]
2024-10-31  9:51   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-29 12:54 ` [PATCH 02/10] clockevents: Shutdown and unregister current clockevents at CPUHP_AP_TICK_DYING Frederic Weisbecker
2024-10-30 20:13   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-31  9:51   ` tip-bot2 for Frederic Weisbecker
     [not found]   ` <CGME20241031121635eucas1p19f01e659d411ceac3b934641bdb457b0@eucas1p1.samsung.com>
2024-10-31 12:16     ` [PATCH 02/10] " Marek Szyprowski
2024-10-31 13:09       ` Thomas Gleixner
2024-10-29 12:54 ` [PATCH 03/10] tick: Remove now unneeded low-res tick stop on CPUHP_AP_TICK_DYING Frederic Weisbecker
2024-10-30 20:13   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-31  9:51   ` tip-bot2 for Frederic Weisbecker
2024-10-29 12:54 ` [PATCH 04/10] ARM: smp_twd: Remove clockevents shutdown call on offlining Frederic Weisbecker
2024-10-30 20:13   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-31  9:51   ` tip-bot2 for Frederic Weisbecker
2024-10-29 12:54 ` [PATCH 05/10] clocksource/drivers/arm_arch_timer: " Frederic Weisbecker
2024-10-30 20:13   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-31  9:51   ` tip-bot2 for Frederic Weisbecker
2024-10-29 12:54 ` [PATCH 06/10] clocksource/drivers/arm_global_timer: " Frederic Weisbecker
2024-10-30 20:13   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-31  9:51   ` tip-bot2 for Frederic Weisbecker
2024-10-29 12:54 ` [PATCH 07/10] clocksource/drivers/exynos_mct: " Frederic Weisbecker
2024-10-30 20:13   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-31  9:51   ` tip-bot2 for Frederic Weisbecker
2024-10-29 12:54 ` [PATCH 08/10] clocksource/drivers/armada-370-xp: " Frederic Weisbecker
2024-10-30 20:13   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-31  9:51   ` tip-bot2 for Frederic Weisbecker
2024-10-29 12:54 ` [PATCH 09/10] clocksource/drivers/qcom: " Frederic Weisbecker
2024-10-30 20:13   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-31  9:51   ` tip-bot2 for Frederic Weisbecker
2024-10-29 12:54 ` [PATCH 10/10] clocksource/drivers/timer-tegra: " Frederic Weisbecker
2024-10-30 20:13   ` [tip: timers/core] " tip-bot2 for Frederic Weisbecker
2024-10-31  9:51   ` tip-bot2 for 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=173031921690.3137.8686198378080958241.tip-bot2@tip-bot2 \
    --to=tip-bot2@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®