• James Hogan's avatar
    clockevents: Retry programming min delta up to 10 times · e28d7c01
    James Hogan authored
    When CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=n, the call path
    hrtimer_reprogram -> clockevents_program_event ->
    clockevents_program_min_delta will not retry if the clock event driver
    returns -ETIME.
    
    If the driver could not satisfy the program_min_delta for any reason, the
    lack of a retry means the CPU may not receive a tick interrupt, potentially
    until the counter does a full period. This leads to rcu_sched timeout
    messages as the stalled CPU is detected by other CPUs, and other issues if
    the CPU is holding locks or other resources at the point at which it
    stalls.
    
    There have been a couple of observed mechanisms through which a clock event
    driver could not satisfy the requested min_delta and return -ETIME.
    
    With the MIPS GIC driver, the shared execution resource within MT cores
    means inconventient latency due to execution of instructions from other
    hardware threads in the core, within gic_next_event, can result in an event
    being set in the past.
    
    Additionally under virtualisation it is possible to get unexpected latency
    during a clockevent device's set_next_event() callback which can make it
    return -ETIME even for a delta based on min_delta_ns.
    
    It isn't appropriate to use MIN_ADJUST in the virtualisation case as
    occasional hypervisor induced high latency will cause min_delta_ns to
    quickly increase to the maximum.
    
    Instead, borrow the retry pattern from the MIN_ADJUST case, but without
    making adjustments. Retry up to 10 times, each time increasing the
    attempted delta by min_delta, before giving up.
    
    [ Matt: Reworked the loop and made retry increase the delta. ]
    Signed-off-by: default avatarJames Hogan <jhogan@kernel.org>
    Signed-off-by: default avatarMatt Redfearn <matt.redfearn@mips.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: linux-mips@linux-mips.org
    Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
    Cc: "Martin Schwidefsky" <schwidefsky@de.ibm.com>
    Cc: James Hogan <james.hogan@mips.com>
    Link: https://lkml.kernel.org/r/1508422643-6075-1-git-send-email-matt.redfearn@mips.com
    e28d7c01
Name
Last commit
Last update
..
bpf Loading commit data...
cgroup Loading commit data...
configs Loading commit data...
debug Loading commit data...
events Loading commit data...
gcov Loading commit data...
irq Loading commit data...
livepatch Loading commit data...
locking Loading commit data...
power Loading commit data...
printk Loading commit data...
rcu Loading commit data...
sched Loading commit data...
time Loading commit data...
trace Loading commit data...
.gitignore Loading commit data...
Kconfig.freezer Loading commit data...
Kconfig.hz Loading commit data...
Kconfig.locks Loading commit data...
Kconfig.preempt Loading commit data...
Makefile Loading commit data...
acct.c Loading commit data...
async.c Loading commit data...
audit.c Loading commit data...
audit.h Loading commit data...
audit_fsnotify.c Loading commit data...
audit_tree.c Loading commit data...
audit_watch.c Loading commit data...
auditfilter.c Loading commit data...
auditsc.c Loading commit data...
backtracetest.c Loading commit data...
bounds.c Loading commit data...
capability.c Loading commit data...
compat.c Loading commit data...
configs.c Loading commit data...
context_tracking.c Loading commit data...
cpu.c Loading commit data...
cpu_pm.c Loading commit data...
crash_core.c Loading commit data...
crash_dump.c Loading commit data...
cred.c Loading commit data...
delayacct.c Loading commit data...
dma.c Loading commit data...
elfcore.c Loading commit data...
exec_domain.c Loading commit data...
exit.c Loading commit data...
extable.c Loading commit data...
fork.c Loading commit data...
freezer.c Loading commit data...
futex.c Loading commit data...
futex_compat.c Loading commit data...
groups.c Loading commit data...
hung_task.c Loading commit data...
irq_work.c Loading commit data...
jump_label.c Loading commit data...
kallsyms.c Loading commit data...
kcmp.c Loading commit data...
kcov.c Loading commit data...
kexec.c Loading commit data...
kexec_core.c Loading commit data...
kexec_file.c Loading commit data...
kexec_internal.h Loading commit data...
kmod.c Loading commit data...
kprobes.c Loading commit data...
ksysfs.c Loading commit data...
kthread.c Loading commit data...
latencytop.c Loading commit data...
memremap.c Loading commit data...
module-internal.h Loading commit data...
module.c Loading commit data...
module_signing.c Loading commit data...
notifier.c Loading commit data...
nsproxy.c Loading commit data...
padata.c Loading commit data...
panic.c Loading commit data...
params.c Loading commit data...
pid.c Loading commit data...
pid_namespace.c Loading commit data...
profile.c Loading commit data...
ptrace.c Loading commit data...
range.c Loading commit data...
reboot.c Loading commit data...
relay.c Loading commit data...
resource.c Loading commit data...
seccomp.c Loading commit data...
signal.c Loading commit data...
smp.c Loading commit data...
smpboot.c Loading commit data...
smpboot.h Loading commit data...
softirq.c Loading commit data...
stacktrace.c Loading commit data...
stop_machine.c Loading commit data...
sys.c Loading commit data...
sys_ni.c Loading commit data...
sysctl.c Loading commit data...
sysctl_binary.c Loading commit data...
task_work.c Loading commit data...
taskstats.c Loading commit data...
test_kprobes.c Loading commit data...
torture.c Loading commit data...
tracepoint.c Loading commit data...
tsacct.c Loading commit data...
ucount.c Loading commit data...
uid16.c Loading commit data...
umh.c Loading commit data...
up.c Loading commit data...
user-return-notifier.c Loading commit data...
user.c Loading commit data...
user_namespace.c Loading commit data...
utsname.c Loading commit data...
utsname_sysctl.c Loading commit data...
watchdog.c Loading commit data...
watchdog_hld.c Loading commit data...
workqueue.c Loading commit data...
workqueue_internal.h Loading commit data...