Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1406264

Re: [RFC][PATCH 2/3] locking: Annotate spin_unlock_wait() users

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 2/3] locking: Annotate spin_unlock_wait() users
Date 2016-05-24 18:20 +0200
Message-ID <rCndL-5Ak-7@gated-at.bofh.it> (permalink)
References <rClF0-4qa-21@gated-at.bofh.it> <rClF1-4qa-53@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 24, 2016 at 7:27 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> spin_unlock_wait() has an unintuitive 'feature' in that it doesn't
> fully serialize against the spin_unlock() we've waited on.

NAK.

We don't start adding more of this "after_ctrl_dep" crap.

It's completely impossible to understand, and even people who have
been locking experts have gotten it wrong.

So it is *completely* unacceptable to have it in drivers.

This needs to be either hidden inside the basic spinlock functions,
_or_ it needs to be a clear and unambiguous interface. Anything that
starts talking about control dependencies is not it.

Note that this really is about naming and use, not about
implementation. So something like "spin_sync_after_unlock_wait()" is
acceptable, even if the actual _implementation_ were to be exactly the
same as the "after_ctrl_dep()" crap.

The difference is that one talks about incomprehensible implementation
details that nobody outside of the person who *implemented* the
spinlock code is supposed to understand (and seriously, I have my
doubts even the spinlock implementer understands it, judging by the
last time this happened), and the other is a much simpler semantic
guarantee.

So don't talk about "acquire". And most certainly don't talk about
"control dependencies". Not if we end up having things like *drivers*
using this like in this example libata.

                Linus

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 0/3] spin_unlock_wait and assorted borkage Peter Zijlstra <peterz@infradead.org> - 2016-05-24 16:40 +0200
  [RFC][PATCH 2/3] locking: Annotate spin_unlock_wait() users Peter Zijlstra <peterz@infradead.org> - 2016-05-24 16:40 +0200
    Re: [RFC][PATCH 2/3] locking: Annotate spin_unlock_wait() users Linus Torvalds <torvalds@linux-foundation.org> - 2016-05-24 18:20 +0200
      Re: [RFC][PATCH 2/3] locking: Annotate spin_unlock_wait() users Tejun Heo <tj@kernel.org> - 2016-05-24 18:30 +0200
        Re: [RFC][PATCH 2/3] locking: Annotate spin_unlock_wait() users Peter Zijlstra <peterz@infradead.org> - 2016-05-24 19:00 +0200
          Re: [RFC][PATCH 2/3] locking: Annotate spin_unlock_wait() users Tejun Heo <tj@kernel.org> - 2016-05-25 21:30 +0200
      Re: [RFC][PATCH 2/3] locking: Annotate spin_unlock_wait() users Peter Zijlstra <peterz@infradead.org> - 2016-05-24 19:00 +0200
  [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep Peter Zijlstra <peterz@infradead.org> - 2016-05-24 16:50 +0200
    Re: [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-05-25 07:00 +0200
      Re: [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep Boqun Feng <boqun.feng@gmail.com> - 2016-05-25 07:40 +0200
        Re: [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-05-25 16:30 +0200
      Re: [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep Waiman Long <waiman.long@hpe.com> - 2016-05-25 17:30 +0200
        Re: [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-05-25 18:00 +0200
          Re: [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep Peter Zijlstra <peterz@infradead.org> - 2016-05-25 18:30 +0200
            Re: [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep Linus Torvalds <torvalds@linux-foundation.org> - 2016-05-25 19:00 +0200
              Re: [RFC][PATCH 1/3] locking: Introduce smp_acquire__after_ctrl_dep "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-05-25 21:00 +0200

csiph-web