aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net
diff options
context:
space:
mode:
authorAhmed S. Darwish <a.darwish@linutronix.de>2020-06-03 16:49:46 +0200
committerDavid S. Miller <davem@davemloft.net>2020-06-04 15:50:42 -0700
commit6501bf87602f799b7e502014f8bc0aa58b868277 (patch)
treef1c76d72ff0a12292f736f7259d8cf18a6d54851 /drivers/net
parentnet: phy: fixed_phy: Remove unused seqcount (diff)
downloadwireguard-linux-6501bf87602f799b7e502014f8bc0aa58b868277.tar.xz
wireguard-linux-6501bf87602f799b7e502014f8bc0aa58b868277.zip
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 'drivers/net')
0 files changed, 0 insertions, 0 deletions