Skip to content

Commit cc51bf6

Browse files
committed
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner: - Cure for not using zalloc in the first place, which leads to random crashes with CPUMASK_OFF_STACK. - Revert a user space visible change which broke udev - Add a missing cpu_online early return introduced by the new full dyntick conversions - Plug a long standing race in the timer wheel cpu hotplug code. Sigh... - Cleanup NOHZ per cpu data on cpu down to prevent stale data on cpu up. * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: time: Revert ALWAYS_USE_PERSISTENT_CLOCK compile time optimizaitons timer: Don't reinitialize the cpu base lock during CPU_UP_PREPARE tick: Don't invoke tick_nohz_stop_sched_tick() if the cpu is offline tick: Cleanup NOHZ per cpu data on cpu down tick: Use zalloc_cpumask_var for allocating offstack cpumasks
2 parents 37cae5e + b4f711e commit cc51bf6

7 files changed

Lines changed: 8 additions & 19 deletions

File tree

‎arch/x86/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ config X86
108108
select GENERIC_CLOCKEVENTS_BROADCAST if X86_64 || (X86_32 && X86_LOCAL_APIC)
109109
select GENERIC_TIME_VSYSCALL if X86_64
110110
select KTIME_SCALAR if X86_32
111-
select ALWAYS_USE_PERSISTENT_CLOCK
112111
select GENERIC_STRNCPY_FROM_USER
113112
select GENERIC_STRNLEN_USER
114113
select HAVE_CONTEXT_TRACKING if X86_64

‎drivers/rtc/Kconfig‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ if RTC_CLASS
2020
config RTC_HCTOSYS
2121
bool "Set system time from RTC on startup and resume"
2222
default y
23-
depends on !ALWAYS_USE_PERSISTENT_CLOCK
2423
help
2524
If you say yes here, the system time (wall clock) will be set using
2625
the value read from a specified RTC device. This is useful to avoid
@@ -29,7 +28,6 @@ config RTC_HCTOSYS
2928
config RTC_SYSTOHC
3029
bool "Set the RTC time based on NTP synchronization"
3130
default y
32-
depends on !ALWAYS_USE_PERSISTENT_CLOCK
3331
help
3432
If you say yes here, the system time (wall clock) will be stored
3533
in the RTC specified by RTC_HCTOSYS_DEVICE approximately every 11

‎include/linux/time.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,10 @@ static inline bool timespec_valid_strict(const struct timespec *ts)
117117

118118
extern bool persistent_clock_exist;
119119

120-
#ifdef ALWAYS_USE_PERSISTENT_CLOCK
121-
#define has_persistent_clock() true
122-
#else
123120
static inline bool has_persistent_clock(void)
124121
{
125122
return persistent_clock_exist;
126123
}
127-
#endif
128124

129125
extern void read_persistent_clock(struct timespec *ts);
130126
extern void read_boot_clock(struct timespec *ts);

‎kernel/time/Kconfig‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ config CLOCKSOURCE_WATCHDOG
1212
config ARCH_CLOCKSOURCE_DATA
1313
bool
1414

15-
# Platforms has a persistent clock
16-
config ALWAYS_USE_PERSISTENT_CLOCK
17-
bool
18-
default n
19-
2015
# Timekeeping vsyscall support
2116
config GENERIC_TIME_VSYSCALL
2217
bool

‎kernel/time/tick-broadcast.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -786,11 +786,11 @@ bool tick_broadcast_oneshot_available(void)
786786

787787
void __init tick_broadcast_init(void)
788788
{
789-
alloc_cpumask_var(&tick_broadcast_mask, GFP_NOWAIT);
790-
alloc_cpumask_var(&tmpmask, GFP_NOWAIT);
789+
zalloc_cpumask_var(&tick_broadcast_mask, GFP_NOWAIT);
790+
zalloc_cpumask_var(&tmpmask, GFP_NOWAIT);
791791
#ifdef CONFIG_TICK_ONESHOT
792-
alloc_cpumask_var(&tick_broadcast_oneshot_mask, GFP_NOWAIT);
793-
alloc_cpumask_var(&tick_broadcast_pending_mask, GFP_NOWAIT);
794-
alloc_cpumask_var(&tick_broadcast_force_mask, GFP_NOWAIT);
792+
zalloc_cpumask_var(&tick_broadcast_oneshot_mask, GFP_NOWAIT);
793+
zalloc_cpumask_var(&tick_broadcast_pending_mask, GFP_NOWAIT);
794+
zalloc_cpumask_var(&tick_broadcast_force_mask, GFP_NOWAIT);
795795
#endif
796796
}

‎kernel/time/tick-sched.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts)
717717
if (unlikely(!cpu_online(cpu))) {
718718
if (cpu == tick_do_timer_cpu)
719719
tick_do_timer_cpu = TICK_DO_TIMER_NONE;
720+
return false;
720721
}
721722

722723
if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
@@ -1168,7 +1169,7 @@ void tick_cancel_sched_timer(int cpu)
11681169
hrtimer_cancel(&ts->sched_timer);
11691170
# endif
11701171

1171-
ts->nohz_mode = NOHZ_MODE_INACTIVE;
1172+
memset(ts, 0, sizeof(*ts));
11721173
}
11731174
#endif
11741175

‎kernel/timer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,12 +1539,12 @@ static int __cpuinit init_timers_cpu(int cpu)
15391539
boot_done = 1;
15401540
base = &boot_tvec_bases;
15411541
}
1542+
spin_lock_init(&base->lock);
15421543
tvec_base_done[cpu] = 1;
15431544
} else {
15441545
base = per_cpu(tvec_bases, cpu);
15451546
}
15461547

1547-
spin_lock_init(&base->lock);
15481548

15491549
for (j = 0; j < TVN_SIZE; j++) {
15501550
INIT_LIST_HEAD(base->tv5.vec + j);

0 commit comments

Comments
 (0)