android_kernel_xiaomi_sm8350/Documentation
Paul E. McKenney dba9cda5aa clocksource: Retry clock read if long delays detected
[ Upstream commit db3a34e17433de2390eb80d436970edcebd0ca3e ]

When the clocksource watchdog marks a clock as unstable, this might be due
to that clock being unstable or it might be due to delays that happen to
occur between the reads of the two clocks.  Yes, interrupts are disabled
across those two reads, but there are no shortage of things that can delay
interrupts-disabled regions of code ranging from SMI handlers to vCPU
preemption.  It would be good to have some indication as to why the clock
was marked unstable.

Therefore, re-read the watchdog clock on either side of the read from the
clock under test.  If the watchdog clock shows an excessive time delta
between its pair of reads, the reads are retried.

The maximum number of retries is specified by a new kernel boot parameter
clocksource.max_cswd_read_retries, which defaults to three, that is, up to
four reads, one initial and up to three retries.  If more than one retry
was required, a message is printed on the console (the occasional single
retry is expected behavior, especially in guest OSes).  If the maximum
number of retries is exceeded, the clock under test will be marked
unstable.  However, the probability of this happening due to various sorts
of delays is quite small.  In addition, the reason (clock-read delays) for
the unstable marking will be apparent.

Reported-by: Chris Mason <clm@fb.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Feng Tang <feng.tang@intel.com>
Link: https://lore.kernel.org/r/20210527190124.440372-1-paulmck@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:53:18 +02:00
..
ABI evm: Refuse EVM_ALLOW_METADATA_WRITES only if an HMAC key is loaded 2021-07-14 16:53:08 +02:00
accounting
admin-guide clocksource: Retry clock read if long delays detected 2021-07-14 16:53:18 +02:00
arm ARM: 9012/1: move device tree mapping out of linear region 2021-05-19 10:08:32 +02:00
arm64
block
bpf
cdrom
core-api XArray: add xas_split 2021-06-10 13:37:14 +02:00
cpu-freq
crypto
dev-tools
devicetree dt-bindings: net: ethernet-controller: fix typo in NVMEM 2021-04-14 08:24:18 +02:00
doc-guide
driver-api ata: make qc_prep return ata_completion_errors 2020-10-01 13:18:26 +02:00
EDID
fault-injection
fb
features
filesystems sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output 2021-03-07 12:20:48 +01:00
firmware_class
firmware-guide
fpga
gpu Merge drm/drm-next into drm-intel-next-queued 2019-08-22 00:10:36 -07:00
hid
hwmon hwmon: (max31790) Fix pwmX_enable attributes 2021-07-14 16:53:14 +02:00
i2c
ia64
ide
iio
infiniband
input
ioctl fs-verity: add UAPI header 2019-07-28 16:59:16 -07:00
isdn
kbuild kbuild: support LLVM=1 to switch the default tools to Clang/LLVM 2020-08-26 10:40:47 +02:00
kernel-hacking
leds
livepatch
locking
m68k
maintainer
media media: videodev2.h: RGB BT2020 and HSV are always full range 2020-11-05 11:43:15 +01:00
mic
mips
misc-devices
netlabel
networking can: j1939: swap addr and pgn in the send example 2020-11-18 19:20:19 +01:00
nios2
openrisc
parisc
PCI
pcmcia
power
powerpc
process
RCU
riscv
s390
scheduler
scsi
security
sh
sound
sparc
sphinx tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
sphinx-static
spi
target tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
timers
trace tweewide: Fix most Shebang lines 2021-05-22 11:38:30 +02:00
translations
usb
userspace-api Documentation: seccomp: Fix user notification documentation 2021-06-03 08:59:03 +02:00
virt KVM: arm64: Reject VM creation when the default IPA size is unsupported 2021-03-17 17:03:57 +01:00
virtual
vm mm/slub: clarify verification reporting 2021-06-23 14:41:30 +02:00
w1
watchdog
x86 x86/CPU/AMD: Save AMD NodeId as cpu_die_id 2020-12-30 11:51:47 +01:00
xtensa xtensa: fix TLBTEMP area placement 2020-11-24 13:29:22 +01:00
.gitignore
asm-annotations.rst linkage: Introduce new macros for assembler symbols 2020-11-10 12:37:24 +01:00
atomic_bitops.txt
atomic_t.txt
bus-virt-phys-mapping.txt
Changes
CodingStyle
conf.py
COPYING-logo
crc32.txt
debugging-modules.txt
debugging-via-ohci1394.txt
digsig.txt
DMA-API-HOWTO.txt
DMA-API.txt
DMA-attributes.txt
DMA-ISA-LPC.txt
docutils.conf
dontdiff
futex-requeue-pi.txt futex-requeue-pi.txt: standardize document format 2017-07-14 13:51:35 -06:00
hwspinlock.txt
index.rst linkage: Introduce new macros for assembler symbols 2020-11-10 12:37:24 +01:00
io_ordering.txt
io-mapping.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
irqflags-tracing.txt
Kconfig
kobject.txt
kprobes.txt
kref.txt
logo.gif
lzo.txt
mailbox.txt
Makefile
memory-barriers.txt
nommu-mmap.txt
padata.txt
percpu-rw-semaphore.txt
pi-futex.txt
preempt-locking.txt
rbtree.txt
remoteproc.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt
speculation.txt
static-keys.txt
SubmittingPatches
tee.txt
this_cpu_ops.txt
unaligned-memory-access.txt
xz.txt