]> git.baikalelectronics.ru Git - kernel.git/commit
seqlock: lockdep assert non-preemptibility on seqcount_t write
authorAhmed S. Darwish <a.darwish@linutronix.de>
Mon, 20 Jul 2020 15:55:14 +0000 (17:55 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 29 Jul 2020 14:14:24 +0000 (16:14 +0200)
commit8fd7b1e8db83cc2a99ebbc1cb70cd831f8f24646
treec8cbe8dbf4fefa28a62622073a2cdd40a9dd36bb
parent72d5acec3df4abae3c21c1ce0454ee58329094e5
seqlock: lockdep assert non-preemptibility on seqcount_t write

Preemption must be disabled before entering a sequence count write side
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.

Assert through lockdep that preemption is disabled for seqcount writers.

Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200720155530.1173732-9-a.darwish@linutronix.de
include/linux/seqlock.h