Re: [PATCH] net: hinic: avoid kernel hung in hinic_get_stats64()
From: maqiao <hidden>
Date: 2022-06-30 14:33:34
Also in:
lkml
From: maqiao <hidden>
Date: 2022-06-30 14:33:34
Also in:
lkml
在 2022/6/30 下午9:59, Eric Dumazet 写道:
On Thu, Jun 30, 2022 at 3:57 PM maqiao [off-list ref] wrote:quoted
在 2022/6/30 下午6:23, Eric Dumazet 写道:quoted
quoted
Note: The following is racy, because multiple threads can call hinic_get_stats64() at the same time. It needs a loop, see include/linux/u64_stats_sync.h for detail.Thanks for reminding, and I noticed that nic_tx_stats/nic_rx_stats has been protected by u64_stats_sync in update_t/rx_stats(), it seems that it's unnecessary to use spinlock in update_nic_stats().It is necessary to use the spinlock to protect writers among themselves.
Ohhh, sorry, I was wrong. I did not realize that seqlock cannot prevent mutil writers enter critical section...
quoted
I will send v2 as soon as possible, thanks.