diff options
author | Ahmed S. Darwish <a.darwish@linutronix.de> | 2020-06-03 17:49:46 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-06-05 01:50:42 +0300 |
commit | 6501bf87602f799b7e502014f8bc0aa58b868277 (patch) | |
tree | f1c76d72ff0a12292f736f7259d8cf18a6d54851 /tools | |
parent | 79cbb6bc3332da7162c2581e151659ab8ebaa528 (diff) | |
download | linux-6501bf87602f799b7e502014f8bc0aa58b868277.tar.xz |
u64_stats: Document writer non-preemptibility requirement
The u64_stats mechanism uses sequence counters to protect against 64-bit
values tearing on 32-bit architectures. Updating such statistics is a
sequence counter write side critical section.
Preemption must be disabled before entering this seqcount write critical
section. Failing to do so, the seqcount read side can preempt the write
side section and spin for the entire scheduler tick. If that reader
belongs to a real-time scheduling class, it can spin forever and the
kernel will livelock.
Document this statistics update side non-preemptibility requirement.
Reword the introductory paragraph to highlight u64_stats raison d'ĂȘtre:
64-bit values tearing protection on 32-bit architectures. Divide
documentation on a basis of internal design vs. usage constraints.
Reword the u64_stats header file top comment to always mention "Reader"
or "Writer" at the start of each bullet point, making it easier to
follow which side each point is actually for.
Clarify the statement "whole thing is a NOOP on 64bit arches or UP
kernels". For 32-bit UP kernels, preemption is always disabled for the
statistics read side section.
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions