From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9903C5AD4C for ; Wed, 15 Nov 2023 20:59:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344853AbjKOU7M (ORCPT ); Wed, 15 Nov 2023 15:59:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344751AbjKOU6A (ORCPT ); Wed, 15 Nov 2023 15:58:00 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 229C61BEE for ; Wed, 15 Nov 2023 12:57:34 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92657C433D9; Wed, 15 Nov 2023 20:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700081232; bh=h0ZKaEE0HTYC5bcqEVV2W24p8gqA+dqk6w8j0fLgoI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aJW94HlEJryjbjShFfsIuLUl5j4dLMCYy/M1rueyNL8OvdVmaHDFUNi3wIIiBiTfy RKVo/wSh/B9m7prs+2ug/4QYvlCJH1kGLvnxrLThE7zLcoP5LSTGoRy/2awtcidd5Q oTCmnTCL+mhTQQvbKV1BOyFNA3tzNB5Gy2YA/gmU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , David Ahern , Neal Cardwell , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 031/244] tcp_metrics: do not create an entry from tcp_init_metrics() Date: Wed, 15 Nov 2023 15:33:43 -0500 Message-ID: <20231115203550.246793447@linuxfoundation.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231115203548.387164783@linuxfoundation.org> References: <20231115203548.387164783@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit a135798e6e200ecb2f864cecca6d257ba278370c ] tcp_init_metrics() only wants to get metrics if they were previously stored in the cache. Creating an entry is adding useless costs, especially when tcp_no_metrics_save is set. Fixes: 51c5d0c4b169 ("tcp: Maintain dynamic metrics in local cache.") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Acked-by: Neal Cardwell Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/ipv4/tcp_metrics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 940f75df19358..def337f72c860 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c @@ -478,7 +478,7 @@ void tcp_init_metrics(struct sock *sk) goto reset; rcu_read_lock(); - tm = tcp_get_metrics(sk, dst, true); + tm = tcp_get_metrics(sk, dst, false); if (!tm) { rcu_read_unlock(); goto reset; -- 2.42.0