All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Octavian Purdila <tavip@google.com>
Cc: Eric Dumazet <edumazet@kernel.org>,
	Neal Cardwell <ncardwell@google.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Shuah Khan <shuah@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	Wei Wang <weiwan@google.com>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2 2/2] selftests: net: packetdrill: add test for negative sk_forward_alloc in tcp_wmem_schedule()
Date: Tue, 20 Oct 2026 18:20:43 -0700	[thread overview]
Message-ID: <20261020182043.4bad43c4@kernel.org> (raw)
In-Reply-To: <20261020163835.4076594-3-tavip@google.com>

On Tue, 20 Oct 2026 16:38:35 +0000 Octavian Purdila wrote:
> Add a packetdrill test that drives sk->sk_forward_alloc negative via
> tcp_collapse() on the receive queue while sk->sk_wmem_queued exceeds
> sysctl_tcp_wmem[0], and verifies that a subsequent non-blocking write()
> under TCP memory pressure fails with EAGAIN rather than returning a
> negative copy length from tcp_wmem_schedule() and failing with EFAULT.

This is failing in our CI, it doesn't need any packetdrill updates,
right?


Here's the AI report about the failure:

The new packetdrill test tcp_wmem_schedule_negative_fwd_alloc.pkt is
failing in our CI (both the regular and debug kernel configs, all three
address-family sub-tests: ipv4, ipv6, ipv4-mapped-ipv6):

  tcp_wmem_schedule_negative_fwd_alloc.pkt:105: runtime error in write call:
  Expected result -1 but got 3680 with errno 22 (Invalid argument)

Instead of the non-blocking write() failing with EAGAIN as the test
expects, it succeeds and returns 3680 bytes. The kernel log for the run
also shows the test's memory cgroup repeatedly entering the OOM-killer
path (try_charge_memcg() -> mem_cgroup_out_of_memory(), "Out of memory
and no killable processes...") from inside tcp_wmem_schedule(), rather
than the write() being throttled and returning -EAGAIN as intended.

This suggests the test's reproduction recipe (tcp_collapse() driving
sk_forward_alloc negative while sk_wmem_queued exceeds
sysctl_tcp_wmem[0]) isn't landing the socket in the TCP memory-pressure
path in our test environment, but instead in the memcg hard-limit/OOM
path, which the companion fix (clamping tcp_wmem_schedule()'s return
value) does not need to handle the same way.

Could you take a look at why the test's preconditions (buffer sizes,
cgroup memory limit, write() size) aren't reliably reproducing the
negative-forward-alloc + EAGAIN scenario in our VM environment? It's
possible the memory cgroup limit used by the test is too tight relative
to the data pushed through write(), causing it to hit the generic memcg
OOM path before/instead of the TCP memory-pressure check.

  reply	other threads:[~2026-10-21  1:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 16:38 [PATCH net v2 0/2] tcp: clamp return value of tcp_wmem_schedule() to non-negative Octavian Purdila
2026-10-20 16:38 ` [PATCH net v2 1/2] " Octavian Purdila
2026-10-20 16:38 ` [PATCH net v2 2/2] selftests: net: packetdrill: add test for negative sk_forward_alloc in tcp_wmem_schedule() Octavian Purdila
2026-10-21  1:20   ` Jakub Kicinski [this message]
2026-10-21  6:02     ` Octavian Purdila

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=20261020182043.4bad43c4@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shakeel.butt@linux.dev \
    --cc=shuah@kernel.org \
    --cc=tavip@google.com \
    --cc=weiwan@google.com \
    --cc=willemb@google.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.