From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 7F586301037 for ; Mon, 26 Jan 2026 11:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769427327; cv=none; b=L35c0C8Cnl1v9DZSmM2BoJmXYRaf3zODfD2MZZ6oQpNKYI5K08fM+4cangV4xMfT1oBipB0mjgYjie55GLZFT/J4yjlwTNtCarZDwnlmrUF0oGzUDPTOxMUa4ZxtZoh2A6HB9b9+qXs2EZi8ppUmleNdvJarbAvYmjg3FyGeKfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769427327; c=relaxed/simple; bh=L+VFtFE8vaxxokw+Pishur3tMraQm5g6ETVyD3plCxo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fVHmOHdsycIQBUrIKK1fUNv0uLslENinLLOcTz1AFh4Ipwd2UIhjpBCQXeLSt7038j6NJMCPiDrst2pbZt5I7k7iJ+qSFLXHPlQeHIA6vSe2wOctDKldAYChQuARr/lPS7gPOwA+LSGBn6lAdzWsfjxS3UKK/aBX3/or1tudgNw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Xi6WGCmH; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xi6WGCmH" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-47ee76e8656so64429715e9.0 for ; Mon, 26 Jan 2026 03:35:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769427325; x=1770032125; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=fMoDGeIwmEnNyi6Vj8HIaY7XY3f1o3JzE6Y7fyQabWE=; b=Xi6WGCmHUTH7L2MloasXSsWS2UH7jmxvFsRFc/Kq3bi7Kh43k9dHz970v5BB1/a6W6 x1SrNX7sGNT6sQy5/+jFzk5IXBzK0kPLpSZOojYp3RayGHWvYK1W4RUjnAr3OqcwTH7X SJFW+vrqiVxSTKcOYGoB9WBz1m9KbsgaRhgMVf1PFMHOa/2NZd41eBJqKYP/tnvwWJ0C xoyPwBSt0duA4E2jSJy9Myuzh59sB6F1LRFJ0hIjlbZcGHvRWDCxXCqOoi9a0Sc4+WCA Xe5AbC3+8B+YNypCMa8A5jR/NWEX1ktbd17S+lAImcS+ShUu9qtiRfFTlJzlIgxj3eyw 0ZyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769427325; x=1770032125; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fMoDGeIwmEnNyi6Vj8HIaY7XY3f1o3JzE6Y7fyQabWE=; b=pFtLdfwmHiC3fHZ6OXeHKh6w4jVID4O0fEec7QiSoo5i5rkdGeG5Av+5ILvGnYdJ3Q h6s5D7K9za6Qqx3D2dBvFlzjzU6ny7Cf+JRM5zCQbtiZmTJI9zixeavXmud7xvB06KtJ UFjkwnH2EuadbfnvQaESKrNqP7/Zn9RnQOAk3m00Gq3FyavDZWqvNGjiBkOI8U4TciHe ciRUfQD2CcKin0NhxqFfQhkny7pnXa5bUcTqTW5YxbfTTWEkgB+lEpkXuZgnGoeB5QfO DmMzYSQYHDpW/oAMNV8IfZteybF5OKIJ98QsUPAW0YFBMnwFOa2ut0TmCr+B6yc4kSQS 8OSg== X-Forwarded-Encrypted: i=1; AJvYcCXCTYQoF1w3zudITZWdCkeXxhYtDlzU4HnMPAxZjmYLcCdnZUbEVAcLOfthgiD9A8rkGGOPNH7vMarkv0g=@vger.kernel.org X-Gm-Message-State: AOJu0YybH7UfCaeia9g3L5nHWLsOXLlTIeD98WQx/Rt3ae70HqnRbqci grt9NXsgCWu1Ku34yx1jt53GYUxafgVfAv6D6FDdsPLvqp2FpcbkmyDO X-Gm-Gg: AZuq6aI1t5VAidylbwGXv6YMpNObV5ep8I5zfbPGgB1VnlGrvuq5yotCkW5paORaBOv AOYNmKi42ZHyXM9utMB1nHJ6KiIJbnIRLXJ5scYdfjhy+DofjFYT5FlHsWV0RsECLz7Ivpgu+R/ 9tYfMOAzU6G6fsjsL5mIPbzX7lozKQI7pANTrkI6/bHIqMpHFSpj/xKuHvAZtau0yNt2Jjc5BdL MefRNgnUGv10m6MAAaa399gOXY/Sf86L72uI5LQkdhvSucktbduWkshcbXrsbON4msoSBUROH/f BHYGdVyik5uqNEHQd2//93eNfmB4BB9frZoXS9w2bwGnRmvPThdPe2tz33V/XY0NVZnX2dTOiCI 7Z/KlE7OJ1x6d0/bGrVIPeJcuoZ+LyItxqTnfHXgGiuZKbTNOC8GPuiI45PBrHMeBdRE0mm9mi6 QfPHGT1MQam/PKb9XXYtk9/NyZPpMPSFI+914VA9AywC7Z92b4VgpD X-Received: by 2002:a05:600c:35c2:b0:47f:b737:5ce0 with SMTP id 5b1f17b1804b1-4805cf66771mr75346305e9.23.1769427324862; Mon, 26 Jan 2026 03:35:24 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4804dbab1b8sm99455265e9.8.2026.01.26.03.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 03:35:24 -0800 (PST) Date: Mon, 26 Jan 2026 11:35:23 +0000 From: David Laight To: Eric Dumazet Cc: Jakub Kicinski , David Yang , netdev@vger.kernel.org, Lino Sanfilippo , Andrew Lunn , "David S. Miller" , Paolo Abeni , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: alacritech: Use u64_stats_t with u64_stats_sync properly Message-ID: <20260126113523.3663baee@pumpkin> In-Reply-To: References: <20260122185113.2760355-1-mmyangfl@gmail.com> <20260125152324.1b7e5a9f@kernel.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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: quoted-printable On Mon, 26 Jan 2026 11:11:09 +0100 Eric Dumazet wrote: > On Mon, Jan 26, 2026 at 12:23=E2=80=AFAM Jakub Kicinski = wrote: > > > > On Fri, 23 Jan 2026 02:51:07 +0800 David Yang wrote: =20 > > > On 64bit arches, struct u64_stats_sync is empty and provides no help > > > against load/store tearing. Convert to u64_stats_t to ensure atomic > > > operations. =20 > > > > Eric, could you comment if this matters? I expect David may send a > > non-trivial number of these, I want to make sure we're making good > > use of everyone's time here. 64b accesses are not torn on 64b arches, > > and never used for control flow. =20 >=20 > I added u64_stats_add()/u64_stats_inc() back in 2019, and never bothered > sending dozens of patches. >=20 > Presumably compilers could be really dumb back then, I am not sure > this is still the case today. >=20 gcc still generates 'crap code' for var_64 +=3D var_32 on x86-32. Basically it zero-extends then does a 64bit add rather than using 'adc $0, %reg_hi', the extra register is likely to force a spill to stack. But that is 'fixed' by using add_u64_u32(). Oh and you really don't want to support adding a signed 32bit value for one place that wants to do a subtract. David