From: Nikolay Aleksandrov <razor@blackwall.org>
To: Hangbin Liu <hangbin.liu@linux.dev>,
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>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Hangbin Liu <liuhangbin@kylinos.cn>
Subject: Re: [PATCH net v5 1/2] bonding: convert unbalanced_load to per-cpu state
Date: Wed, 26 Aug 2026 10:34:11 +0300 [thread overview]
Message-ID: <3b77ed31-549e-4bb6-a7c6-b4f65dbdf784@blackwall.org> (raw)
In-Reply-To: <20260825-bond_overflow-v5-1-7a800de133f1@kylinos.cn>
On 25/08/2026 04:01, Hangbin Liu wrote:
> From: Hangbin Liu <liuhangbin@kylinos.cn>
>
> A later patch widens the bonding TLB tx counters from u32 to u64. The
> unbalanced_load counter sits in the transmit hot path, and cross-CPU
> synchronization of a u64 would introduce measurable overhead. Convert
> unbalanced_load to a per-cpu counter first so that the subsequent
> widening only touches per-cpu data local to each CPU.
>
> Introduce struct unbalanced_load_stats to hold the per-cpu counter,
> and move the aggregation into a helper, reset_unbalanced_load(), which
> sums all per-cpu instances. Use the delta of current total load vs
> variable prev_total_unbalanced to calculate the loading.
>
> Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
> ---
> drivers/net/bonding/bond_alb.c | 37 ++++++++++++++++++++++++++++++-------
> include/net/bond_alb.h | 7 ++++++-
> 2 files changed, 36 insertions(+), 8 deletions(-)
>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
next prev parent reply other threads:[~2026-08-26 7:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 1:01 [PATCH net v5 0/2] bonding: fix TLB load-tracking overflow on high-speed NICs Hangbin Liu
2026-08-25 1:01 ` [PATCH net v5 1/2] bonding: convert unbalanced_load to per-cpu state Hangbin Liu
2026-08-26 7:34 ` Nikolay Aleksandrov [this message]
2026-08-25 1:01 ` [PATCH net v5 2/2] bonding: fix u32 overflow in compute_gap() Hangbin Liu
2026-08-26 7:34 ` Nikolay Aleksandrov
2026-08-27 13:42 ` Paolo Abeni
2026-08-28 1:28 ` Hangbin Liu
2026-08-27 18:20 ` David Laight
2026-08-27 19:09 ` Nikolay Aleksandrov
2026-08-27 20:56 ` David Laight
2026-08-28 9:19 ` 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=3b77ed31-549e-4bb6-a7c6-b4f65dbdf784@blackwall.org \
--to=razor@blackwall.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hangbin.liu@linux.dev \
--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 \
/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