From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C251E1917F0 for ; Sun, 24 May 2026 16:12:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779639145; cv=none; b=Gzu0XMUD+fCb1QOlECEvs8JvR7/mqhJEnzyJ/b8hg1Zld162bKMxxiwLQMM5JcAlvmBGfkNeVbwrCNY7j9vxFlipvy9B1wkqLrFL09l5qsHv+JCAapbrTSmSoIkMTUqGDQtygJQ3HL/lWBpo/lMZIAORhANGrJPXvc18pdY9BPg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779639145; c=relaxed/simple; bh=w9yKY5uzhHZM7eBv6T5AwBrhui8FkBo9X3dBJUH3eeQ=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=fdvI2rvydPAS1+ONvaAc3bgN670P05f+dqsc2d3ZNpprhbmbCVVQ8Ty9mUZjGsO1wacClt+kun4APQ1k61VstbpqOE8aSUXq5tosEQ2DlsOLoBq1ZVm3D7l+3zcGrUY5lAeYoecd+PNoP6s3rCfDZ8ywLzs14JUbc7Vyu0NBCKI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-484cf882ce5so6475190b6e.1 for ; Sun, 24 May 2026 09:12:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779639143; x=1780243943; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5No0a8el/S4DN81L6TAFYHT4iKPCKKGFHoR2sjKktaI=; b=oLv1tUynyj39pbKkZdgRfVkDUjApyqgyHrcGSmpSCNyz0/mIaoNL8HNyAVS1s+BG7H OITLRbK8JrSuQBzPV6285IZXqf1JxtNnKcCoLnflCzVvra9MMPftPQ5x3aA+f7mFxSPV 9MqHxZDVFbw+XLQk7jrvBJanymFw0blNCVLrhhet0Nf0o5xiNKBt/fuW63an3q+7v+Ri ch0AMVrbDSW/Q2Pqvl4lqnDdUPJxWHDX0pFdCj+FAceHrKTIcDqrk4FQEouCKp+OsFfI bGgF25vAY3cyY9KMpx7Tft9rxat9A3C9WyqkRXlDPvuWFgGfIkESvDfOvJ+4D5NiQhc6 acCA== X-Forwarded-Encrypted: i=1; AFNElJ9YcQzLDo3v9eECwHNbpyNGAOFu5Bk25DxvPxrw5H46MAMCMHcgsB47hIrMywv1ulhQLV6DP9JVZolz9So=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/GYpKJJE0BD8qWyuIgA0AeE1BKoToc4lQ1Y71Ejg7NiFB2bYh xqoUF3hlZawAHblVaNQLI4evira2PZ9c7NnvqVIE8arALLnfjhuJJzj3 X-Gm-Gg: Acq92OG87weyYNqO8BLxkiKBqwXspTbNzDacZxGhBVo8CXdYFtSaKiuWQALei9qzMOE JKYT3v0Rc/tis8FylHycy+mEFIGZukLEPlaBwwPBiNH/9VqqQoSaFlxMIDEdrc1SfK/avjk/3nD ybesF975fhZOiOOrYJGy5II9MK+tGlfhIJ2UhwtejyAMuoYon7Y8Sx6fIlkRWT0+zA0Rh566fGe lKLR3lxMZUN9ZdLgaRKimnmfRaIOq0B1eStUU5xygaSR7MWTSOX0cdS6rNCK/ejams6vXD/e1+o F9tD1pz0SpbilczVFUDE2jzrp8ghmFtV4myh9TcDIpdqsu+sK54ilJ6Xdsfy8Vtmr4IWwgiGSqz 7zZYg+1f8ct5pEuFk3PIeuZ/4cueN5Q+MVO36VkbKcf2G3fDAEuWF0lD020jSqdx4cEyFPjoGVB pRrxiXqQQu0ypSdw== X-Received: by 2002:a05:6808:1644:b0:482:ed71:8ffa with SMTP id 5614622812f47-48549d53137mr6942537b6e.15.1779639142683; Sun, 24 May 2026 09:12:22 -0700 (PDT) Received: from localhost ([2a03:2880:10ff:5c::]) by smtp.gmail.com with ESMTPSA id 5614622812f47-48554041ccasm3466086b6e.0.2026.05.24.09.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2026 09:12:22 -0700 (PDT) From: Breno Leitao Subject: [PATCH 0/9] netconsole: stop charging every netpoll user for netconsole-only state Date: Sun, 24 May 2026 09:12:16 -0700 Message-Id: <20260524-netconsole_move_more-v1-0-909d1ab398b4@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAGAjE2oC/yXMWwrCMBBG4a0M/3MDab2FbEVENJnoiCYlU4tQu vfS+nLgvHwTlKuwwtOEyqOolAxPbUMIz1t+sJEIT+hsd7SHdm8yD6FkLW++fsq4prJxzqXIdhd TOKEh9JWT/Db2fPm/fu8vDsNqYZ4XReteq3gAAAA= X-Change-ID: 20260514-netconsole_move_more-888fde03dfc7 To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, gustavold@gmail.com, asantostc@gmail.com, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-d5d98 X-Developer-Signature: v=1; a=openpgp-sha256; l=2734; i=leitao@debian.org; h=from:subject:message-id; bh=w9yKY5uzhHZM7eBv6T5AwBrhui8FkBo9X3dBJUH3eeQ=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBqEyNlrXaSTOjCYS1qAyQ0hLMOFnpzAr0uTC3N7 KOGCC1F7CKJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCahMjZQAKCRA1o5Of/Hh3 bdUrD/9TOZuwwCEIt7OGP5rNi/Rdg/msDJbVvib2zGaA8ciOszvO4bqX1S83HeRZZU+9//K6ZFQ K9H9Ltx+7/CHh/KTJUc96AfngF1ksiteYH7SlBY0kJHPDcJFOS6NbqoleUuNACDmLI6sWsYnjPz 8djpxeWGjFJFiDMGVGivTpn++0oEeCLtuB8mPPAaQjLIr6eH3egwNS/kInJ+djyg9AsODKiRl7j UAorDvcg8Zdb0wMK0sxtokK7QzpWxtc4TK/KBjTrCzoOvM1s5JdAPz3k9ss4JAw05gXYSNh23W8 10ndsAKHhMJY2nWsi3hHf21OJ9OyccTRv///i6PktR3VKRT7TtkUT7nMcxWa/LuFDRn6aXFzFNP H5iQ07pKxP2tJKjJ0AjQNKxj1m/vwE+Is5PJ0v8jaVnfwPbLVQ+h+9e0RYkShfnS8V4ZJ2WL9YS ycPiJDSMpCexE4x5O2MypfDnbGksRTeKDCmnu6IQ7hSnNufn5MheC8VpuBKrNjc9fwHwerLOvJj JEwirX8HjdDoj03wzm+OY7A1PR5y3jF5wiuPJuuZ8HPAAkTaAJh7q/6NkI2KEHUZYWqmSHtuJEk wBulX2JWlM355gdkVKIA8/BsNkMf031L5ahz0Gb1Ynp0TDTwYp1S+Hk8GtLbMdro9tI4GGCeWgZ rvP6dvnmY7ECsjg== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D struct netpoll is shared by every netpoll consumer in the tree: bonding, bridge, team, vlan, macvlan, dsa and netconsole. The non- netconsole users only need a per-port handle that lets them transmit SKBs. Yet struct netpoll has accumulated a pile of fields that exist only to serve netconsole's printk path: - skb_pool / refill_wq: the fallback skb pool find_skb() falls back on when alloc_skb() returns NULL, plus the workqueue that refills it. - local_port / remote_port / remote_mac: the source and destination UDP ports and the destination ethernet address used to build outgoing log packets. - local_ip / remote_ip / ipv6: the source and destination IP addresses and the family selector for the same packets. Every netpoll user that allocates a struct netpoll and pays for all of these fields, even though it never queues a single skb on the pool, never sends a UDP frame and never looks at any of the addressing. The fix is to move netconsole-only state out of the shared struct into struct netconsole_target, where its only consumer already lives. After the series, every passive netpoll consumer drops sizeof(sk_buff_head) + sizeof(work_struct) + 2 * sizeof(u16) + ETH_ALEN bytes per port (plus padding), and struct netpoll keeps only what genuinely belongs to the generic poll/transmit abstraction or what netpoll core still has to read itself. Follow-ups ---------- local_ip, remote_ip and ipv6 are still in struct netpoll, as they are left for a follow-up posting to keep each series focused on a single responsibility transfer. Signed-off-by: Breno Leitao --- Breno Leitao (9): netpoll: export refill_skbs(), refill_skbs_work_handler(), skb_pool_flush() netconsole: take over skb pool lifecycle from netpoll netconsole: move refill_skbs_work_handler() from netpoll netconsole: move refill_skbs() and skb-pool sizing macros from netpoll netconsole: move skb_pool_flush() from netpoll netconsole: move skb_pool / refill_wq from struct netpoll to netconsole_target netconsole: move local_port from struct netpoll to netconsole_target netconsole: move remote_port from struct netpoll to netconsole_target netconsole: move remote_mac from struct netpoll to netconsole_target drivers/net/netconsole.c | 188 ++++++++++++++++++++++++++++++++++++----------- include/linux/netpoll.h | 4 - net/core/netpoll.c | 58 +-------------- 3 files changed, 145 insertions(+), 105 deletions(-) --- base-commit: 150061a2065192d77a4f6518b6238be81dfb8321 change-id: 20260514-netconsole_move_more-888fde03dfc7 Best regards, -- Breno Leitao