From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.virtuozzo.com (relay.virtuozzo.com [130.117.225.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9EBC37C92C; Thu, 9 Apr 2026 21:47:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=130.117.225.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775771279; cv=none; b=Tl0R3sURPxYCIxk6WuamkeORDbNLU7FZIVXrDiynOWacTFp9pKhJ3gb0HGXYs6h7pUjho/j1oafmw03Pfiq3UtRD3sq0Ni31JrSaWAjgwml90QRewdYKXQWlWnV8Do0o/YR9MZRvAHuFAnE8gGJtfiPEYuEgjOvw7WtwT4Te9Ks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775771279; c=relaxed/simple; bh=8tsXI5GWVUlhJaYC/LK3zhp+R7hyhPbm41VUEHqo5p0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qZc9Dti5+66GL4r1kzn86pSyIJWSoQW4aYVIxjkfXtyZa1zBikTurMSpRIRe0nfWdBbZ8cJIwC0ICumAPWw+grSMnMODtZP52iHaQ1PbDZ0tMg2vwGUbLWjMmmYfByF6Kr518unrkLX8BZdUoXI2hHi7Qngmz8+CygK12rpzJ0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=virtuozzo.com; spf=pass smtp.mailfrom=virtuozzo.com; dkim=pass (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b=eVop7GSp; arc=none smtp.client-ip=130.117.225.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=virtuozzo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=virtuozzo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="eVop7GSp" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=7SNfDvJtC0DyGm9hfzn/dNerAkSGQ1wxTuVdvFD0rFY=; b=eVop7GSpqu9d 9rAxQOjmSsWn4sGLDD7vPiyfTVvl9XQ/7W/9tTd6ijQYdssY5zi33q1nCKNIAMAGntrzwVc4EkUdh k33Cc8DKiHIAEwggUEPc9ibPDk+IDpZ3fynBOzELunz5bZuWfaifWuZy9ADmz5r+bdyWKbrdl4NfC aXaANFWWaQlb0xDt/KxwZD7/buhTlxTghbJyZzgE6cm0yi2h+ua4WtjcwszwFilAx3IM9p/LL/DWS OGA6SFRWSYjAHGyHgPevDsr9kykzIVTTVb/J6AFTlNuw0u63sIdwMtCQOXgW7KF35g/i11Fd5sgdc 061Sh1LBb+NRDv86jUG68g==; Received: from [130.117.225.5] (helo=finist-alma9.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1wAxBX-002p6C-2H; Thu, 09 Apr 2026 23:47:34 +0200 From: Konstantin Khorenko To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Arnd Bergmann , Peter Oberparleiter , Mikhail Zaslonko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pavel Tikhomirov , Vasileios Almpanis , Konstantin Khorenko Subject: [PATCH v2 2/2] net: add noinline __no_profile to skb_extensions_init() for GCOV compatibility Date: Fri, 10 Apr 2026 00:47:36 +0300 Message-ID: <20260409214736.2651198-3-khorenko@virtuozzo.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20260409214736.2651198-1-khorenko@virtuozzo.com> References: <20260402140558.1437002-1-khorenko@virtuozzo.com> <20260409214736.2651198-1-khorenko@virtuozzo.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit With -fprofile-update=atomic in global CFLAGS_GCOV, GCC still cannot constant-fold the skb_ext_total_length() loop when it is inlined into a profiled caller. The existing __no_profile on skb_ext_total_length() itself is insufficient because after __always_inline expansion the code resides in the caller's body, which still carries GCOV instrumentation. Mark skb_extensions_init() with __no_profile so the BUILD_BUG_ON checks can be evaluated at compile time. Also mark it noinline to prevent the compiler from inlining it into skb_init() (which lacks __no_profile), which would re-expose the function body to GCOV instrumentation. Build-tested with both CONFIG_GCOV_PROFILE_ALL=y and CONFIG_KCOV_INSTRUMENT_ALL=y. Signed-off-by: Konstantin Khorenko --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 59fb4b2bb821..8d75e352e3b1 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5153,7 +5153,7 @@ static __always_inline __no_profile unsigned int skb_ext_total_length(void) return l; } -static void skb_extensions_init(void) +static noinline void __no_profile skb_extensions_init(void) { BUILD_BUG_ON(SKB_EXT_NUM > 8); BUILD_BUG_ON(skb_ext_total_length() > 255); -- 2.43.5