The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: Nikolay Aleksandrov <razor@blackwall.org>
Cc: Jay Vosburgh <jv@jvosburgh.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hangbin Liu <liuhangbin@kylinos.cn>
Subject: Re: [PATCH net v3 2/2] bonding: fix u32 overflow in compute_gap()
Date: Wed, 19 Aug 2026 10:09:58 +0800	[thread overview]
Message-ID: <aoUQdublxcfZzqzE@fedora> (raw)
In-Reply-To: <aoUP0sLeEhCPxukB@fedora>

On Wed, Aug 19, 2026 at 10:07:22AM +0800, Hangbin Liu wrote:
> > > > ... this here, as u64_stats_update_begin doesn't provide exclusive access, so writers
> > > > must do that themselves, so you can't be sure what value will end up, the zeroing
> > > > might not work at all and can get overwritten
> > > > 
> > > 
> > > I meant - it doesn't improve on the current situation where it can also happen. :)
> 
> Ah, yes. I forgot this. The reset_unbalanced_load() could be called on any
> CPU, which conflicts with other writers.
> 
> I re-checked the code. unbalanced_load is only called in two situations:
> 1. To rebalance the load in bond_alb_monitor(), which only executes once
>    every 10 seconds.
> 2. !tx_slave in bond_do_alb_xmit(), which is only for multicast/broadcast
>    traffic. This traffic shouldn't be significant.
> 
> So looks using spin_lock here is acceptable. What do you think?

I mean, drop the per-CPU design directly and use spin_lock to protect the data.

Hangbin

  reply	other threads:[~2026-08-19  2:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  8:47 [PATCH net v3 0/2] bonding: fix TLB load-tracking overflow on high-speed NICs Hangbin Liu
2026-08-18  8:47 ` [PATCH net v3 1/2] bonding: convert unbalanced_load to per-cpu state Hangbin Liu
2026-08-18  9:42   ` Nikolay Aleksandrov
2026-08-19  1:11     ` Hangbin Liu
2026-08-18  8:47 ` [PATCH net v3 2/2] bonding: fix u32 overflow in compute_gap() Hangbin Liu
2026-08-18  9:44   ` Nikolay Aleksandrov
2026-08-18 11:06     ` Nikolay Aleksandrov
2026-08-18 11:51       ` Nikolay Aleksandrov
2026-08-19  2:07         ` Hangbin Liu
2026-08-19  2:09           ` Hangbin Liu [this message]
2026-08-19  8:35             ` Nikolay Aleksandrov
2026-08-19  9:51               ` Hangbin Liu
2026-08-19 10:02                 ` Nikolay Aleksandrov

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=aoUQdublxcfZzqzE@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@kylinos.cn \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    /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