android_kernel_motorola_sm6375/kernel/time
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jason A. Donenfeld 043b97bc30
UPSTREAM: wireguard: ratelimiter: use hrtimer in selftest
Using msleep() is problematic because it's compared against
ratelimiter.c's ktime_get_coarse_boottime_ns(), which means on systems
with slow jiffies (such as UML's forced HZ=100), the result is
inaccurate. So switch to using schedule_hrtimeout().

However, hrtimer gives us access only to the traditional posix timers,
and none of the _COARSE variants. So now, rather than being too
imprecise like jiffies, it's too precise.

One solution would be to give it a large "range" value, but this will
still fire early on a loaded system. A better solution is to align the
timeout to the actual coarse timer, and then round up to the nearest
tick, plus change.

So add the timeout to the current coarse time, and then
schedule_hrtimer() until the absolute computed time.

This should hopefully reduce flakes in CI as well. Note that we keep the
retry loop in case the entire function is running behind, because the
test could still be scheduled out, by either the kernel or by the
hypervisor's kernel, in which case restarting the test and hoping to not
be scheduled out still helps.

Bug: 254441685
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 151c8e499f4705010780189377f85b57400ccbf5)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: If0f81458956e47506732a17f72d3b6f7965d9cfe
2025-09-24 12:16:40 +02:00
..
alarmtimer.c
clockevents.c
clocksource.c
hrtimer.c UPSTREAM: wireguard: ratelimiter: use hrtimer in selftest 2025-09-24 12:16:40 +02:00
itimer.c
jiffies.c
Kconfig
Makefile
ntp.c ntp: Safeguard against time_constant overflow 2024-08-19 05:33:52 +02:00
ntp_internal.h
posix-clock.c posix-clock: posix-clock: Fix unbalanced locking in pc_clock_settime() 2024-11-08 16:20:51 +01:00
posix-cpu-timers.c UPSTREAM: posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del() 2025-06-30 11:40:28 +01:00
posix-stubs.c
posix-timers.c This is the 5.4.294 stable release 2025-06-05 07:11:21 +00:00
posix-timers.h
sched_clock.c
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c tick/broadcast: Move per CPU pointer access into the atomic section 2024-08-19 05:33:51 +02:00
tick-common.c tick/nohz_full: Don't abuse smp_call_function_single() in tick_setup_device() 2024-07-05 09:08:19 +02:00
tick-internal.h
tick-oneshot.c
tick-sched.c Merge tag 'ASB-2024-06-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-06-22 17:58:09 +03:00
tick-sched.h
time.c Merge 5.4.287 into android11-5.4-lts 2024-12-16 10:50:16 +00:00
timeconst.bc
timeconv.c
timecounter.c
timekeeping.c timekeeping: Fix cross-timestamp interpolation for non-x86 2024-03-26 18:22:14 -04:00
timekeeping.h
timekeeping_debug.c
timekeeping_internal.h
timer.c Merge tag 'ASB-2024-06-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-06-22 17:58:09 +03:00
timer_list.c
vsyscall.c