All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: Joel Fernandes <joelaf@google.com>
Cc: "Joel Fernandes (Google)" <joel@joelfernandes.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Laurent Dufour <ldufour@linux.ibm.com>,
	Suren Baghdasaryan <surenb@google.com>
Subject: Re: Silencing false lockdep warning related to seq lock
Date: Mon, 17 May 2021 12:21:38 +0800	[thread overview]
Message-ID: <YKHvUkxpytzSewEC@boqun-archlinux> (raw)
In-Reply-To: <CAJWu+orW9PA7m_s5LHhQv-bEO0xFq7n+9-fznd79boKkmQUR6g@mail.gmail.com>

Hi,

On Fri, May 14, 2021 at 10:52:31AM -0400, Joel Fernandes wrote:
> Hi Boqun,
> You might have worked on such issues so I thought you're a good person to ask.
> 
> After apply Laurent's SPF patchset [1] , we're facing a large number
> of (seemingly false positive) lockdep reports which are related to
> circular dependencies with seq locks.
> 
>  lock(A); write_seqcount(B)
>   vs.
> write_seqcount(B); lock(A)
> 

Two questions here:

*	Could you provide the lockdep splats you saw? I wonder whether
	it's similar to the one mentioned in patch #9[1].

*	What keeps write_seqcount(vm_seqcount) serialized? If it's only
	one lock that serializes the writers, we probably can make it
	as the nest_lock argument for seqcount_acquire(), and that will
	help prevent the false positives.

Regards,
Boqun

[1]: https://lore.kernel.org/lkml/20190416134522.17540-10-ldufour@linux.ibm.com/

> This cannot deadlock obviously. My current strategy which I hate is to
> make it a raw seqcount write which bypasses lockdep. That's horrible
> for obvious reasons. Do you have any tricks/patches up your sleeve to
> silence these?
> 
> I suppose we still want to catch lockdep issues of the form (which
> peterz chatted to me about):
> 
>  lock(A); write_seqcount(B)
>   vs.
> read_seqcount(B); lock(A)
> 
> which seems like it can deadlock.
> 
> I would rather make lockdep useful to catch these and not miss out on
> them. Let me know what you think?
> 
> Cheers,
> -Joel
> 
> [1] https://lkml.org/lkml/2019/4/16/615

  reply	other threads:[~2021-05-17  4:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 14:52 Silencing false lockdep warning related to seq lock Joel Fernandes
2021-05-17  4:21 ` Boqun Feng [this message]
2021-05-18  1:52   ` Joel Fernandes
2021-05-18  2:24     ` Boqun Feng
2021-05-18 15:53       ` Joel Fernandes
2021-05-19  4:50         ` Boqun Feng

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=YKHvUkxpytzSewEC@boqun-archlinux \
    --to=boqun.feng@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=joelaf@google.com \
    --cc=ldufour@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=surenb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.