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


Groups > linux.kernel > #1405671

Re: [PATCH] locking/mutex: Set and clear owner using WRITE_ONCE()

From Jason Low <jason.low2@hpe.com>
Newsgroups linux.kernel
Subject Re: [PATCH] locking/mutex: Set and clear owner using WRITE_ONCE()
Date 2016-05-24 00:00 +0200
Message-ID <rC63f-2R9-3@gated-at.bofh.it> (permalink)
References <rAELL-5Nf-7@gated-at.bofh.it> <rB0VX-3pl-7@gated-at.bofh.it> <rB3At-5jE-1@gated-at.bofh.it> <rC4Xw-2dT-15@gated-at.bofh.it> <rC5JU-2KA-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 2016-05-23 at 14:31 -0700, Davidlohr Bueso wrote:
> On Mon, 23 May 2016, Jason Low wrote:
> 
> >On Fri, 2016-05-20 at 18:00 -0700, Davidlohr Bueso wrote:
> >> On Fri, 20 May 2016, Waiman Long wrote:
> >>
> >> >I think mutex-debug.h also needs similar changes for completeness.
> >>
> >> Maybe, but given that with debug the wait_lock is unavoidable, doesn't
> >> this send the wrong message?
> >
> >The mutex_set_owner() and mutex_clear_owner() can still get called in
> >the fastpath without the wait_lock for the debug case too correct?
> 
> The fastpath is a nop, see mutex-null:
> 
> #define __mutex_fastpath_lock(count, fail_fn)		fail_fn(count)

Oh right, so then the mutex_set_owner() call in mutex_lock() doesn't
really matter. I'll update the patch to remove the use of WRITE_ONCE for
the debug case then, and add the comments about why it is different as
suggested.

Thanks,
Jason

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


Thread

[PATCH] locking/mutex: Set and clear owner using WRITE_ONCE() Jason Low <jason.low2@hpe.com> - 2016-05-20 00:40 +0200
  Re: [PATCH] locking/mutex: Set and clear owner using WRITE_ONCE() Davidlohr Bueso <dave@stgolabs.net> - 2016-05-20 03:20 +0200
  Re: [PATCH] locking/mutex: Set and clear owner using WRITE_ONCE() Jason Low <jason.low2@hpe.com> - 2016-05-21 00:20 +0200
  Re: [PATCH] locking/mutex: Set and clear owner using WRITE_ONCE() Davidlohr Bueso <dave@stgolabs.net> - 2016-05-21 03:10 +0200
    Re: [PATCH] locking/mutex: Set and clear owner using WRITE_ONCE() Waiman Long <waiman.long@hpe.com> - 2016-05-21 06:10 +0200
    Re: [PATCH] locking/mutex: Set and clear owner using WRITE_ONCE() Jason Low <jason.low2@hpe.com> - 2016-05-23 22:50 +0200
      Re: [PATCH] locking/mutex: Set and clear owner using WRITE_ONCE() Davidlohr Bueso <dave@stgolabs.net> - 2016-05-23 23:40 +0200
        Re: [PATCH] locking/mutex: Set and clear owner using WRITE_ONCE() Jason Low <jason.low2@hpe.com> - 2016-05-24 00:00 +0200

csiph-web