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

timekeeping: Remove timekeeper.total_sleep_time

No more users. Remove it

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>

authored by

Thomas Gleixner and committed by
John Stultz
47da70d3 02cba159

+5 -15
+2 -4
include/linux/timekeeper_internal.h
··· 20 20 * the tv_nsec part positive so we can use the usual normalization. 21 21 * 22 22 * wall_to_monotonic is moved after resume from suspend for the 23 - * monotonic time not to jump. We need to add total_sleep_time to 24 - * wall_to_monotonic to get the real boot based time offset. 23 + * monotonic time not to jump. To calculate the real boot time offset 24 + * we need to do offs_real - offs_boot. 25 25 * 26 26 * - wall_to_monotonic is no longer the boot time, getboottime must be 27 27 * used instead. ··· 51 51 /* Offset clock monotonic -> clock tai */ 52 52 ktime_t offs_tai; 53 53 54 - /* time spent in suspend */ 55 - struct timespec64 total_sleep_time; 56 54 /* The current UTC to TAI offset in seconds */ 57 55 s32 tai_offset; 58 56
+3 -11
kernel/time/timekeeping.c
··· 97 97 tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0)); 98 98 } 99 99 100 - static void tk_set_sleep_time(struct timekeeper *tk, struct timespec64 t) 100 + static inline void tk_update_sleep_time(struct timekeeper *tk, ktime_t delta) 101 101 { 102 - /* Verify consistency before modifying */ 103 - WARN_ON_ONCE(tk->offs_boot.tv64 != timespec64_to_ktime(tk->total_sleep_time).tv64); 104 - 105 - tk->total_sleep_time = t; 106 - tk->offs_boot = timespec64_to_ktime(t); 102 + tk->offs_boot = ktime_add(tk->offs_boot, delta); 107 103 } 108 104 109 105 /** ··· 915 919 set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec); 916 920 tk_set_wall_to_mono(tk, tmp); 917 921 918 - tmp.tv_sec = 0; 919 - tmp.tv_nsec = 0; 920 - tk_set_sleep_time(tk, tmp); 921 - 922 922 timekeeping_update(tk, TK_MIRROR); 923 923 924 924 write_seqcount_end(&tk_core.seq); ··· 942 950 } 943 951 tk_xtime_add(tk, delta); 944 952 tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, *delta)); 945 - tk_set_sleep_time(tk, timespec64_add(tk->total_sleep_time, *delta)); 953 + tk_update_sleep_time(tk, timespec64_to_ktime(*delta)); 946 954 tk_debug_account_sleep_time(delta); 947 955 } 948 956