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: <2f6119ae-128d-48ba-b7ef-d5a610df8a7f@linux.dev>
Date: Tue, 15 Oct 2024 11:25:00 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Michael Chan <michael.chan@...adcom.com>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] bnxt_en: replace PTP spinlock with seqlock

On 15/10/2024 00:35, Jakub Kicinski wrote:
> On Mon, 14 Oct 2024 16:29:47 -0700 Vadim Fedorenko wrote:
>> -	spin_lock_bh(&ptp->ptp_lock);
>> +	write_seqlock_irqsave(&ptp->ptp_lock, flags);
>>   	timecounter_adjtime(&ptp->tc, delta);
>> -	spin_unlock_bh(&ptp->ptp_lock);
>> +	write_sequnlock_irqrestore(&ptp->ptp_lock, flags);
> 
> I think when you adjtime / adjfine (IOW on all the write path) you still
> need the spin lock. But in addition also the seq lock. And then the
> read path can take just the seq lock.

I think there is a spinlock in seqlock_t which is used to prevent
multiple writers.

> This will also remove any uncertainty about the bit ops.

Should I use read_seqlock_excl_bh()/write_seqlock_bh() for the bit ops
then?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ