Re: [PATCH v2 5/6] block: nr_sects_write(): Disable preemption on seqcount write

From: Jens Axboe
Date: Thu Jun 04 2020 - 23:22:59 EST


On 6/3/20 8:49 AM, Ahmed S. Darwish wrote:
> For optimized block readers not holding a mutex, the "number of sectors"
> 64-bit value is protected from tearing on 32-bit architectures by a
> sequence counter.
>
> Disable preemption before entering that sequence counter's write side
> critical section. Otherwise, the read side can preempt the write side
> section and spin for the entire scheduler tick. If the reader belongs to
> a real-time scheduling class, it can spin forever and the kernel will
> livelock.

Applied, thanks.

--
Jens Axboe