From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Michael Chan <michael.chan@broadcom.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] bnxt_en: replace PTP spinlock with seqlock
Date: Tue, 15 Oct 2024 11:25:00 +0100 [thread overview]
Message-ID: <2f6119ae-128d-48ba-b7ef-d5a610df8a7f@linux.dev> (raw)
In-Reply-To: <20241014163538.1ac0d88d@kernel.org>
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?
next prev parent reply other threads:[~2024-10-15 10:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 23:29 [PATCH net-next] bnxt_en: replace PTP spinlock with seqlock Vadim Fedorenko
2024-10-14 23:35 ` Jakub Kicinski
2024-10-15 10:25 ` Vadim Fedorenko [this message]
2024-10-15 15:41 ` Jakub Kicinski
2024-10-15 6:20 ` Michael Chan
2024-10-15 13:01 ` Vadim Fedorenko
2024-10-18 12:21 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2f6119ae-128d-48ba-b7ef-d5a610df8a7f@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).