lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260105153729.0e1241b9@kernel.org>
Date: Mon, 5 Jan 2026 15:37:29 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Qingfang Deng <dqfext@...il.com>
Cc: David Yang <mmyangfl@...il.com>, netdev@...r.kernel.org, Andrew Lunn
 <andrew@...n.ch>, Vladimir Oltean <olteanv@...il.com>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
 <pabeni@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v3 2/2] net: dsa: yt921x: Protect MIB stats
 with a lock

On Mon,  5 Jan 2026 10:51:39 +0800 Qingfang Deng wrote:
> On Mon, 5 Jan 2026 10:09:01 +0800, David Yang wrote:
> > 64bit variables might not be atomic on 32bit architectures, thus cannot
> > be made lock-free. Protect them with a spin lock since get_stats64()
> > cannot sleep.  
> 
> Synchronizing both reads and updates with a spin lock is an overkill.
> See include/linux/u64_stats_sync.h for a better approach.

OTOH seq locks require error prone retry logic, YMMV.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ