mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: maqiao <mqaio@linux.alibaba.com>
To: Eric Dumazet <edumazet@google.com>
Cc: David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	gustavoars@kernel.org, cai.huoqing@linux.dev,
	Aviad Krawczyk <aviad.krawczyk@huawei.com>,
	zhaochen6@huawei.com, netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: hinic: avoid kernel hung in hinic_get_stats64()
Date: Thu, 30 Jun 2022 22:15:14 +0800	[thread overview]
Message-ID: <529eadf1-5c7a-2068-2932-8e75ae02e405@linux.alibaba.com> (raw)
In-Reply-To: <CANn89iJ-2BTR1SfFBbNG3jSgHK-TuRE_J-Khbbednu=pWnFtmw@mail.gmail.com>



在 2022/6/30 下午9:59, Eric Dumazet 写道:
> On Thu, Jun 30, 2022 at 3:57 PM maqiao <mqaio@linux.alibaba.com> wrote:
>>
>>
>>
>> 在 2022/6/30 下午6:23, Eric Dumazet 写道:
> 
>>> 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...
> 
> 
>>
>> I will send v2 as soon as possible, thanks.

      reply	other threads:[~2022-06-30 14:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29  7:28 Qiao Ma
2022-06-30  9:56 ` Paolo Abeni
2022-06-30 14:20   ` maqiao
2022-06-30 10:07 ` Paolo Abeni
2022-06-30 10:23 ` Eric Dumazet
2022-06-30 13:57   ` maqiao
2022-06-30 13:59     ` Eric Dumazet
2022-06-30 14:15       ` maqiao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529eadf1-5c7a-2068-2932-8e75ae02e405@linux.alibaba.com \
    --to=mqaio@linux.alibaba.com \
    --cc=aviad.krawczyk@huawei.com \
    --cc=cai.huoqing@linux.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gustavoars@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=zhaochen6@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®