All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Qingfang Deng <dqfext@gmail.com>
Cc: David Yang <mmyangfl@gmail.com>,
	netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 2/2] net: dsa: yt921x: Protect MIB stats with a lock
Date: Mon, 5 Jan 2026 15:37:29 -0800	[thread overview]
Message-ID: <20260105153729.0e1241b9@kernel.org> (raw)
In-Reply-To: <20260105025139.2348-1-dqfext@gmail.com>

On Mon,  5 Jan 2026 10:51:39 +0800 Qingfang Deng wrote:
> On Mon, 5 Jan 2026 10:09:01 +0800, David Yang wrote:
> > 64bit variables might not be atomic on 32bit architectures, thus cannot
> > be made lock-free. Protect them with a spin lock since get_stats64()
> > cannot sleep.  
> 
> Synchronizing both reads and updates with a spin lock is an overkill.
> See include/linux/u64_stats_sync.h for a better approach.

OTOH seq locks require error prone retry logic, YMMV.

  reply	other threads:[~2026-01-05 23:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05  2:08 [PATCH net-next v3 0/2] net: dsa: yt921x: Fix MIB overflow wraparound routine David Yang
2026-01-05  2:09 ` [PATCH net-next v3 1/2] " David Yang
2026-01-05  2:09 ` [PATCH net-next v3 2/2] net: dsa: yt921x: Protect MIB stats with a lock David Yang
2026-01-05  2:51   ` Qingfang Deng
2026-01-05 23:37     ` Jakub Kicinski [this message]
2026-01-06  1:33   ` Jakub Kicinski

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=20260105153729.0e1241b9@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmyangfl@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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.