All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	davem@davemloft.net, daniel@iogearbox.net, edumazet@google.com,
	jannh@google.com, netdev@vger.kernel.org, kernel-team@fb.com,
	Waiman Long <longman@redhat.com>
Subject: Re: [PATCH bpf-next 2/4] bpf: fix lockdep false positive in stackmap
Date: Wed, 30 Jan 2019 20:44:07 +0100	[thread overview]
Message-ID: <20190130194407.GA3085@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190130193040.3hmh6g7efk5z3g2j@ast-mbp.dhcp.thefacebook.com>

On Wed, Jan 30, 2019 at 11:30:41AM -0800, Alexei Starovoitov wrote:
> On Wed, Jan 30, 2019 at 11:15:30AM +0100, Peter Zijlstra wrote:
> > On Tue, Jan 29, 2019 at 08:04:56PM -0800, Alexei Starovoitov wrote:
> > > Lockdep warns about false positive:
> > 
> > This is not a false positive, and you probably also need to use
> > down_read_non_owner() to match this up_read_non_owner().
> > 
> > {up,down}_read() and {up,down}_read_non_owner() are not only different
> > in the lockdep annotation; there is also optimistic spin stuff that
> > relies on 'owner' tracking.
> 
> Can you point out in the code the spin bit?

Hurmph, looks like you're right. I got lost in that stuff again. I hate
that rwsem code :/

Rewriting that all is on the todo list somewhere, but it's far down :/

> As far as I can see sem->owner is debug only feature.
> All owner checks are done under CONFIG_DEBUG_RWSEMS.
> 
> Also there is no down_read_trylock_non_owner() at the moment.
> We can argue about it for -next, but I'd rather silence lockdep
> with this patch today.

I don't agree with calling is silencing; it fixes an mis-use of the API.
But yes, keep the patch as is for now.

  parent reply	other threads:[~2019-01-30 19:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30  4:04 [PATCH bpf-next 0/4] bpf: fixes for lockdep and deadlock Alexei Starovoitov
2019-01-30  4:04 ` [PATCH bpf-next 1/4] bpf: fix lockdep false positive in percpu_freelist Alexei Starovoitov
2019-01-30 10:21   ` Peter Zijlstra
2019-01-30 19:27     ` Alexei Starovoitov
2019-01-30 19:53       ` Peter Zijlstra
2019-01-30 20:18         ` Alexei Starovoitov
2019-01-30  4:04 ` [PATCH bpf-next 2/4] bpf: fix lockdep false positive in stackmap Alexei Starovoitov
2019-01-30 10:15   ` Peter Zijlstra
2019-01-30 19:30     ` Alexei Starovoitov
2019-01-30 19:42       ` Waiman Long
2019-01-30 20:10         ` Alexei Starovoitov
2019-01-30 21:11           ` Waiman Long
2019-01-30 21:32             ` Waiman Long
2019-01-31  2:01               ` Alexei Starovoitov
2019-01-31  2:48                 ` Waiman Long
2019-02-06  3:21                   ` Eric Dumazet
2019-02-06  3:30                     ` Alexei Starovoitov
2019-02-06  3:40                       ` Eric Dumazet
2019-01-30 19:44       ` Peter Zijlstra [this message]
2019-01-30 20:05         ` Waiman Long
2019-01-30  4:04 ` [PATCH bpf-next 3/4] bpf: fix lockdep false positive in bpf_prog_register Alexei Starovoitov
2019-01-30 10:10   ` Peter Zijlstra
2019-01-30 10:37     ` Peter Zijlstra
2019-01-30 19:32     ` Alexei Starovoitov
2019-01-30 19:46       ` Peter Zijlstra
2019-01-30  4:04 ` [PATCH bpf-next 4/4] bpf: Fix syscall's stackmap lookup potential deadlock Alexei Starovoitov
2019-01-30  4:07 ` [PATCH bpf-next 0/4] bpf: fixes for lockdep and deadlock Alexei Starovoitov

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=20190130194407.GA3085@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jannh@google.com \
    --cc=kernel-team@fb.com \
    --cc=longman@redhat.com \
    --cc=netdev@vger.kernel.org \
    /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.