Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Yang <mmyangfl@gmail.com>
Cc: netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/4] net: dsa: motorcomm: Use u64_stats_t for MIB stats
Date: Fri, 4 Sep 2026 15:03:21 +0200	[thread overview]
Message-ID: <8405d824-1a7a-4058-a390-ac7200fb5936@lunn.ch> (raw)
In-Reply-To: <CAAXyoMNd1mR_EvCLhjvmKjCzDDXCqWdka-Gn1e8_atnnvGvw1w@mail.gmail.com>

On Fri, Sep 04, 2026 at 10:58:06AM +0800, David Yang wrote:
> On Fri, Sep 4, 2026 at 12:25 AM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > On Thu, Sep 03, 2026 at 10:35:08PM +0800, David Yang wrote:
> > > 64-bit variables might not be atomic on 32-bit architectures, and could
> > > lead to load/store tearing. Use u64_stats_t to ensure consistency.
> >
> > Can this patch also be broken up. It should be possible to use
> > u64_stats_read() without changing the locking? So one patch which only
> > does u64_stats_read(). You should then be able to add the syncp
> > code. And lastly the mutex changes. That then allows you to explain
> > why the mutex changes are safe in the commit message.
> >
> >     Andrew
> 
> u64_stats_read are meant to be used with syncp. This sounds like an
> incorrect partial patch, works only because of the internal
> implementation of u64_stats_t.

What is making the current code correct? The mutex? So long as you
have the mutex, the code is still correct?


You can say in the commit message this is an intermediary step doing
the mechanical work of introducing u64_stats_t. The following patches
will then change the locking to be more efficient.

     Andrew

  reply	other threads:[~2026-09-04 13:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 14:35 [PATCH net-next 0/4] net: dsa: motorcomm: MIB fixup David Yang
2026-09-03 14:35 ` [PATCH net-next 1/4] net: dsa: motorcomm: Split MIB module David Yang
2026-09-03 15:01   ` Andrew Lunn
2026-09-03 14:35 ` [PATCH net-next 2/4] net: dsa: motorcomm: Split MIB buffers David Yang
2026-09-03 16:17   ` Andrew Lunn
2026-09-03 14:35 ` [PATCH net-next 3/4] net: dsa: motorcomm: Use u64_stats_t for MIB stats David Yang
2026-09-03 16:25   ` Andrew Lunn
2026-09-04  2:58     ` David Yang
2026-09-04 13:03       ` Andrew Lunn [this message]
2026-09-03 14:35 ` [PATCH net-next 4/4] net: dsa: motorcomm: Use safe 64-bit counter reader David Yang

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=8405d824-1a7a-4058-a390-ac7200fb5936@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox