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.

hrtimer: Ensure timerfd notification for HIGHRES=n

If high resolution timers are disabled the timerfd notification about a
clock was set event is not happening for all cases which use
clock_was_set_delayed() because that's a NOP for HIGHRES=n, which is wrong.

Make clock_was_set_delayed() unconditially available to fix that.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210713135158.196661266@linutronix.de

+19 -21
-5
include/linux/hrtimer.h
··· 318 318 319 319 extern void hrtimer_interrupt(struct clock_event_device *dev); 320 320 321 - extern void clock_was_set_delayed(void); 322 - 323 321 extern unsigned int hrtimer_resolution; 324 322 325 323 #else 326 324 327 325 #define hrtimer_resolution (unsigned int)LOW_RES_NSEC 328 - 329 - static inline void clock_was_set_delayed(void) { } 330 326 331 327 #endif 332 328 ··· 347 351 timer->base->get_time()); 348 352 } 349 353 350 - extern void clock_was_set(void); 351 354 #ifdef CONFIG_TIMERFD 352 355 extern void timerfd_clock_was_set(void); 353 356 #else
+16 -16
kernel/time/hrtimer.c
··· 777 777 retrigger_next_event(NULL); 778 778 } 779 779 780 - static void clock_was_set_work(struct work_struct *work) 781 - { 782 - clock_was_set(); 783 - } 784 - 785 - static DECLARE_WORK(hrtimer_work, clock_was_set_work); 786 - 787 - /* 788 - * Called from timekeeping and resume code to reprogram the hrtimer 789 - * interrupt device on all cpus. 790 - */ 791 - void clock_was_set_delayed(void) 792 - { 793 - schedule_work(&hrtimer_work); 794 - } 795 - 796 780 #else 797 781 798 782 static inline int hrtimer_is_hres_enabled(void) { return 0; } ··· 859 875 on_each_cpu(retrigger_next_event, NULL, 1); 860 876 #endif 861 877 timerfd_clock_was_set(); 878 + } 879 + 880 + static void clock_was_set_work(struct work_struct *work) 881 + { 882 + clock_was_set(); 883 + } 884 + 885 + static DECLARE_WORK(hrtimer_work, clock_was_set_work); 886 + 887 + /* 888 + * Called from timekeeping and resume code to reprogram the hrtimer 889 + * interrupt device on all cpus and to notify timerfd. 890 + */ 891 + void clock_was_set_delayed(void) 892 + { 893 + schedule_work(&hrtimer_work); 862 894 } 863 895 864 896 /*
+3
kernel/time/tick-internal.h
··· 165 165 166 166 extern u64 get_next_timer_interrupt(unsigned long basej, u64 basem); 167 167 void timer_clear_idle(void); 168 + 169 + void clock_was_set(void); 170 + void clock_was_set_delayed(void);