Re: [PATCH] virtio_net: add local_bh_disable() around u64_stats_update_begin
From: Toshiaki Makita <hidden>
Date: 2018-10-18 09:06:57
Also in:
virtualization
From: Toshiaki Makita <hidden>
Date: 2018-10-18 09:06:57
Also in:
virtualization
On 2018/10/18 17:43, Sebastian Andrzej Siewior wrote:
on 32bit, lockdep notices that virtnet_open() and refill_work() invoke
try_fill_recv() from process context while virtnet_receive() invokes the
same function from BH context. The problem that the seqcounter within
u64_stats_update_begin() may deadlock if it is interrupted by BH and
then acquired again.
Introduce u64_stats_update_begin_bh() which disables BH on 32bit
architectures. Since the BH might interrupt the worker, this new
function should not limited to SMP like the others which are expected
to be used in softirq.
With this change we might lose increments but this is okay. The
important part that the two 32bit parts of the 64bit counter are not
corrupted.
Fixes: 461f03dc99cf6 ("virtio_net: Add kick stats").
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>NACK. Again, this race should not happen because of NAPI guard. We need to investigate why this warning happened. -- Toshiaki Makita