Skip to content

Commit 61ca6c7

Browse files
committed
Merge tag 'timers-urgent-2024-08-04' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner: "Two fixes for the timer/clocksource code: - The recent fix to make the take over of the broadcast timer more reliable retrieves a per CPU pointer in preemptible context. This went unnoticed in testing as some compilers hoist the access into the non-preemotible section where the pointer is actually used, but obviously compilers can rightfully invoke it where the code put it. Move it into the non-preemptible section right to the actual usage side to cure it. - The clocksource watchdog is supposed to emit a warning when the retry count is greater than one and the number of retries reaches the limit. The condition is backwards and warns always when the count is greater than one. Fixup the condition to prevent spamming dmesg" * tag 'timers-urgent-2024-08-04' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource: Fix brown-bag boolean thinko in cs_watchdog_read() tick/broadcast: Move per CPU pointer access into the atomic section
2 parents 6cc82dc + f2655ac commit 61ca6c7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

kernel/time/clocksource.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static enum wd_read_status cs_watchdog_read(struct clocksource *cs, u64 *csnow,
246246

247247
wd_delay = cycles_to_nsec_safe(watchdog, *wdnow, wd_end);
248248
if (wd_delay <= WATCHDOG_MAX_SKEW) {
249-
if (nretries > 1 || nretries >= max_retries) {
249+
if (nretries > 1 && nretries >= max_retries) {
250250
pr_warn("timekeeping watchdog on CPU%d: %s retried %d times before success\n",
251251
smp_processor_id(), watchdog->name, nretries);
252252
}

kernel/time/tick-broadcast.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,6 @@ void tick_broadcast_switch_to_oneshot(void)
11411141
#ifdef CONFIG_HOTPLUG_CPU
11421142
void hotplug_cpu__broadcast_tick_pull(int deadcpu)
11431143
{
1144-
struct tick_device *td = this_cpu_ptr(&tick_cpu_device);
11451144
struct clock_event_device *bc;
11461145
unsigned long flags;
11471146

@@ -1167,6 +1166,8 @@ void hotplug_cpu__broadcast_tick_pull(int deadcpu)
11671166
* device to avoid the starvation.
11681167
*/
11691168
if (tick_check_broadcast_expired()) {
1169+
struct tick_device *td = this_cpu_ptr(&tick_cpu_device);
1170+
11701171
cpumask_clear_cpu(smp_processor_id(), tick_broadcast_force_mask);
11711172
tick_program_event(td->evtdev->next_event, 1);
11721173
}

0 commit comments

Comments
 (0)