All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: maqiao <mqaio@linux.alibaba.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 15:59:48 +0200	[thread overview]
Message-ID: <CANn89iJ-2BTR1SfFBbNG3jSgHK-TuRE_J-Khbbednu=pWnFtmw@mail.gmail.com> (raw)
In-Reply-To: <8b012bbd-a175-5699-1f26-108dd52fc5b7@linux.alibaba.com>

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.


>
> I will send v2 as soon as possible, thanks.

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29  7:28 [PATCH] net: hinic: avoid kernel hung in hinic_get_stats64() 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 [this message]
2022-06-30 14:15       ` maqiao

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='CANn89iJ-2BTR1SfFBbNG3jSgHK-TuRE_J-Khbbednu=pWnFtmw@mail.gmail.com' \
    --to=edumazet@google.com \
    --cc=aviad.krawczyk@huawei.com \
    --cc=cai.huoqing@linux.dev \
    --cc=davem@davemloft.net \
    --cc=gustavoars@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mqaio@linux.alibaba.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.