mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Omar Ramadan <omar@blockcast.net>
To: netdev-bot+sashiko@kernel.org
Cc: ap420073@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	horms@kernel.org
Subject: Re: [PATCH net-next v3 3/3] amt: make the per-tunnel group and source limits configurable
Date: Tue, 24 Nov 2026 07:25:56 +0000	[thread overview]
Message-ID: <20261124072558.846669-1-omar@blockcast.net> (raw)
In-Reply-To: <179547826432.3135.16263442399696125291@kernel.org>

On Mon, 23 Nov 2026 23:57:44 +0000, netdev-bot+sashiko@kernel.org wrote:
> Do these new ceilings also raise the per-packet work a remote gateway can
> cause under tunnel->lock by roughly 32x?

Yes. At 512 groups and 4096 sources the budget of 2/3 allowed 3,850,240
bucket and source visits per Update, 32 times the 120,320 at the
defaults, and the caps were argued from memory only.

v4 caps the budget at what one report as large as the device's MTU can
cost: a host splits its report to the MTU, so a report names at most
mtu / 8 groups. On a 1500-byte stream link (relay MTU 1460) that is
416,256 visits at the ceilings, 3.5 times the default; the largest
legitimate report there costs about 348,000. The defaults keep the 120,320. A report
larger than the relay's own MTU, from a gateway on a jumbo link to a
relay on a standard one, has the records past the bound ignored at high
limits; the commit message says so.

Measured in a UML guest (KASAN off, so only the ratio means anything),
v3 and v4 booted alternately on one machine, at the ceilings: the
report you describe, ~7,500 empty records naming one group that holds
4,096 sources, takes 8.2-8.9 ms in v3 and 1.3-1.6 ms in v4 on a
1500-byte stream link (119 records applied against 13), and 5.3-5.7 ms
with the stream link at 65535. A full refresh is not slower.

Teardown at the ceilings walks 512 * 256 bucket heads in v4, once per
tunnel.

> With hash_buckets at AMT_HSIZE_MAX, do the per-group and per-tunnel
> allocations end up just over 4 KiB?

Yes. v4 keeps hash_buckets at AMT_HSIZE (256): pahole gives 200 bytes
for amt_group_node and 168 for amt_tunnel_list, so with 256 heads both
stay in kmalloc-4k. At 4096 sources in one group a chain averages 16
entries, which only makes a lookup longer. One tunnel at the ceilings
then holds about 2 MiB of group nodes and 0.75 MiB of source nodes, and
max_tunnels multiplies that; v4's comment on the caps says so instead
of "a few MiB".

I will send v4.

pw-bot: cr

-- 
Omar

      reply	other threads:[~2026-11-24  7:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 23:57 [PATCH net-next v3 0/3] amt: configurable per-tunnel limits, with bounded report work Omar Ramadan
2026-11-22 23:57 ` [PATCH net-next v3 1/3] amt: make the A-B source walk linear Omar Ramadan
2026-11-22 23:57 ` [PATCH net-next v3 2/3] amt: bound the source-state work of one Membership Update Omar Ramadan
2026-11-23 23:57   ` netdev-bot+sashiko
2026-11-22 23:57 ` [PATCH net-next v3 3/3] amt: make the per-tunnel group and source limits configurable Omar Ramadan
2026-11-23 23:57   ` netdev-bot+sashiko
2026-11-24  7:25     ` Omar Ramadan [this message]

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=20261124072558.846669-1-omar@blockcast.net \
    --to=omar@blockcast.net \
    --cc=andrew+netdev@lunn.ch \
    --cc=ap420073@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --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

all inboxes | Powered by JetHome®