Article View: linux.kernel.netdev
Article #5814Re: [PATCH net v2 2/2] selftests: net: packetdrill: add test for negative sk_forward_alloc in tcp_wmem_schedule()
From: Jakub Kicinski
Date: Wed, 21 Oct 2026 01:20
Date: Wed, 21 Oct 2026 01:20
41 lines
10085 bytes
10085 bytes
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.
Technical Details
Message-ID:
<20261020182043.4bad43c4@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349693-linux-kernel-netdev=dewy.ruReferences:
<20261020163835.4076594-1-tavip@google.com> <20261020163835.4076594-3-tavip@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349693-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <20261020182043.4bad43c4@kernel.org> References: <20261020163835.4076594-1-tavip@google.com> <20261020163835.4076594-3-tavip@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="4010318"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:jTU4E0iWxbgCp7I4SwBMq/nLO80= sha256:yM0HO4XSsQpt06VPsZEtiMrKkgrMcp6d7M3JXw2qWPk= sha1:TIfjtikfoxfBUuhdDh/fuI2L+SY= sha256:cxsTPLedw/nCdG0Fo180yWu5vMMaxIGrA71HoJJYfmA= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 4B7F5110044; Wed, 21 Oct 2026 04:21:10 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.729 X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MZ5QCwYxYV7i; Wed, 21 Oct 2026 04:21:07 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349693-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 4FFB5110E4E; Wed, 21 Oct 2026 04:20:58 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 24F0B35A4F; Wed, 21 Oct 2026 01:20:51 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792545651; b=fbywe/nf51DqKSoOT4+0oObdZ9FbAjs0R78znqL/6gHY6dDla5/xv5+K6/QZA1gPXa8R cy466j7MSwFmjxMB1TeMoSKbHQ4XSNv0uKWWCbL2KziNSltzSWvAxvUgwnM8dGAi5eNDr AQ1MRmAIlqf3yo5YOs+Q95PVyvvCmIdZbnQGwwNTro06bIPNaOoU0JVPhRN14VvoXwcK4 Clk8WfkCbrtk5jq9v9g2Uevgo+yWJsqoRZUGrMWpiGlr5NIhRWyvwNwZQsjveLzW8m9CR 0DoXCCwai3A1MXmwEFXuMlSyt2iZVAAAmxoeH4sbzt4yWizWJygzLt8yClOYAbXtnew== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792545651; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:In-Reply-To:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=Y8K6h3c2W1891Dy16+/NGD/NBVfIeHRHvnejW7iH4m8=; b=wKII1Riw/FJz8JeVTy9UgK+pE1CrkyA6RdETscuDEIv5VDpu9J9d0coLhygmTZc385fP 0YqV61e1qsGahq02tvsT+MYUmT+ekCpadUVDfxjEvdpi0qJDwS9Y9NGR3H6nVHSAoPCVU OdLGCk2SHWuw7nXQzKwdqiwFMRf6TseYVu+1odOOjOJyun9INONDNiTNUpWq4OpH/VfX3 Om5CCTIXK7EtVwPVXQSE14IKe4gXs/Q0Y7ZD/poyqXDKz9DRhQdnougKO8SQDR4/gPVsX aH+YMDEgb0PiWFW45w3c4YO4RgOul2iM8xAjWMLI96QZWwOF8KawhqUbeIJYXLc++sA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=buzeQ591; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDD61606A321; Wed, 21 Oct 2026 01:20:50 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=buzeQ591 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792545645; b=PwAl2NEKVJVqMZrdIXaCGCPgCAwA+6eMZ81x/ysKxcWvkrUbo144wh72toNWMIZyQdBe 2LNxyeiGntla8aigp3vdX8o/sm+YSLdYCT/BG+CcpSTAZT8rdYx4HRuO/y4bcdW2FDMBM Ss/GaFMbE2VfUPriGvd/i0WdSbm1JR0U61o+GVYnFmQ5t7NBBEAJFjiXIp5pOIcOdrhth Jm2U1pAxiFpkwYN3jXYKNEg0mGH3Ea09Hgv6d1S4rnQAVCdHL88xebGO6o9wwAeU3orVu A2q/1EcQncPpvilF8dALyfkt8F5ZnnociZID70c0YcRHeoBZc+03c1O4YYRPtymbrXw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792545645; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=Y8K6h3c2W1891Dy16+/NGD/NBVfIeHRHvnejW7iH4m8=; b=va4w1hotv6BJKDmBHvnf3uodSbMtn11k9WdsiP8/UCuhIF4K6Xm4it95llsoniUiQizG sAp3prdLySdFFf/BTGBp7yiseTuWX69r+/LdRLsRB8VYvP0qWo2tmtPAmJFqotrS1TSQm 5+gPBEJnjY8Wkz3rzvE4pKVB90MEXjCqYfu3jQ+mqCG8n12DS+7N9IvFpPhpXoxEcc493 yZDVBnFRjGck9oep9Pdl0VJT6IrB+DSmBZFHegvI3+61UHQK2EURmK99jC17+stB4Rtg9 nw2o9g1jPmZ42eHXFXrE2b561ABpJQUQXeITq4j9xtzb726IjciZEuIHLpoCnAH6y1A== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=buzeQ591; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8F24606A319; Wed, 21 Oct 2026 01:20:44 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B47A1F000C9; Wed, 21 Oct 2026 01:20:44 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792545644; bh=Y8K6h3c2W1891Dy16+/NGD/NBVfIeHRHvnejW7iH4m8=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=buzeQ591Xxk1VSUAF/qr7f7EWTEuDqUpWdL3dAoG6uQqNcleiAk8ssBP0t+yOa5e7 hN5gKI0RI9Jpo1+ERNIliqwXeCwXFKKRfVaO6J9ox5Scc0vrGaGeLUByNJEGh8cD6H 8+Ckhpiaj/HFGvYvOOgqkeTlLvuTBbi+WAtdfh9Jq/F23TlCOdEe3xARfRLgA3AZ1T y16Su+E4++NrJutP9WPQr9DAe9V4F5wKV7rW3iFjG2y8NiXs+hlX4jAwIpSXtDFG5N PO+ytlPTEPAgJMLBKW0REfotttN3jSpIoky8g78z46IQF1286pdSGp4PRNxWqidf+b /NPQpXiCEWtTA== X-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 X-In-Reply-To: <20261020163835.4076594-3-tavip@google.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list