Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Frederic Weisbecker and committed by
Thomas Gleixner
17a8945f b35108a5

+10 -2
+10 -2
kernel/time/clockevents.c
··· 337 337 } 338 338 339 339 /* 340 - * Called after a notify add to make devices available which were 341 - * released from the notifier call. 340 + * Called after a clockevent has been added which might 341 + * have replaced a current regular or broadcast device. A 342 + * released normal device might be a suitable replacement 343 + * for the current broadcast device. Similarly a released 344 + * broadcast device might be a suitable replacement for a 345 + * normal device. 342 346 */ 343 347 static void clockevents_notify_released(void) 344 348 { 345 349 struct clock_event_device *dev; 346 350 351 + /* 352 + * Keep iterating as long as tick_check_new_device() 353 + * replaces a device. 354 + */ 347 355 while (!list_empty(&clockevents_released)) { 348 356 dev = list_entry(clockevents_released.next, 349 357 struct clock_event_device, list);