From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 33A90223DE1; Mon, 23 Jun 2025 21:17:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750713468; cv=none; b=tDyQRh8+s4cAI34sd/Gg+OtQ/6D90DEsaLgwB+IWSwe+GiHByKQpNVDVvJEj7Se7dUiktOz3IFt7kccVOevkbZXA0imyp268TOPWJG+n4afWp4W0hXt5HtDvMdWpllea0jENf0GCVzNKKjNoWnZxWsfzMbUwcAC6NjVVuFl4gk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750713468; c=relaxed/simple; bh=moBkJiRg4meP8GCbxnRwVSyg/0pKDvIGztgwTHGvHU4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gmxOxZKkrM+29BaCfKeS1zrNVEHNLcDY+n6VbevF9yTHN2RSU/8RCEZNA781wnCsVI2IwLzCgxArGqETI4R2sGNrN6GQk/y0f+N0MbqEH1rsxTuZNqaFN3Rr5Qu8sTxayFNcUqBT+kn27gG+vT8X3fBcv6xqy+ds21qGcuqGr+A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NtdDl4dg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NtdDl4dg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C000AC4CEEA; Mon, 23 Jun 2025 21:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750713468; bh=moBkJiRg4meP8GCbxnRwVSyg/0pKDvIGztgwTHGvHU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NtdDl4dghcHQQTqfyyZ5CO+b8TVIxVqbcTAJzAWPVfPFu0/ffcVjXezPqAgsPOtFW vqZcg08HQSmm5ENzaURM6p6HCo+42MzAeEg8B0JZgM5QbOYHhCT/wOjRKDqMpSvU/A USYB2NGYvc+tSDR8pu+bFa7163+ul/+A49PP2ZW8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Ahern , Sebastian Andrzej Siewior , Paolo Abeni , Sasha Levin Subject: [PATCH 6.15 349/592] ipv4/route: Use this_cpu_inc() for stats on PREEMPT_RT Date: Mon, 23 Jun 2025 15:05:07 +0200 Message-ID: <20250623130708.748770448@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130700.210182694@linuxfoundation.org> References: <20250623130700.210182694@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sebastian Andrzej Siewior [ Upstream commit 1c0829788a6e6e165846b9bedd0b908ef16260b6 ] The statistics are incremented with raw_cpu_inc() assuming it always happens with bottom half disabled. Without per-CPU locking in local_bh_disable() on PREEMPT_RT this is no longer true. Use this_cpu_inc() on PREEMPT_RT for the increment to not worry about preemption. Cc: David Ahern Signed-off-by: Sebastian Andrzej Siewior Link: https://patch.msgid.link/20250512092736.229935-4-bigeasy@linutronix.de Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- net/ipv4/route.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 753704f75b2c6..5d7c7efea66cc 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -189,7 +189,11 @@ const __u8 ip_tos2prio[16] = { EXPORT_SYMBOL(ip_tos2prio); static DEFINE_PER_CPU(struct rt_cache_stat, rt_cache_stat); +#ifndef CONFIG_PREEMPT_RT #define RT_CACHE_STAT_INC(field) raw_cpu_inc(rt_cache_stat.field) +#else +#define RT_CACHE_STAT_INC(field) this_cpu_inc(rt_cache_stat.field) +#endif #ifdef CONFIG_PROC_FS static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) -- 2.39.5