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: Tue, 29 Oct 2024 13:54:42 +0100 [thread overview]
Message-ID: <20241029125451.54574-2-frederic@kernel.org> (raw)
In-Reply-To: <20241029125451.54574-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
next prev parent reply other threads:[~2024-10-29 12:54 UTC|newest]
Thread overview: 34+ 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 ` Frederic Weisbecker [this message]
2024-10-30 20:13 ` [tip: timers/core] clockevents: Improve clockevents_notify_released() comment tip-bot2 for Frederic Weisbecker
2024-10-31 9:51 ` 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
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
-- strict thread matches above, loose matches on Subject: below --
2024-10-17 16:50 [PATCH 00/10] clockevents: Rearrange cpuhotplug operations Frederic Weisbecker
2024-10-17 16:50 ` [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=20241029125451.54574-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.