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


Groups > linux.kernel > #1719168

Re: [PATCH] rwsem: fix missed wakeup due to reordering of load

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] rwsem: fix missed wakeup due to reordering of load
Date 2017-08-24 13:30 +0200
Message-ID <uhYuK-5Me-5@gated-at.bofh.it> (permalink)
References <uhC1c-8iX-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


WTH did you not Cc the people that commented on your patch last time?

On Wed, Aug 23, 2017 at 04:58:55PM +0530, Prateek Sood wrote:
> If a spinner is present, there is a chance that the load of
> rwsem_has_spinner() in rwsem_wake() can be reordered with
> respect to decrement of rwsem count in __up_write() leading
> to wakeup being missed.

>  spinning writer                  up_write caller
>  ---------------                  -----------------------
>  [S] osq_unlock()                 [L] osq
>   spin_lock(wait_lock)
>   sem->count=0xFFFFFFFF00000001
>             +0xFFFFFFFF00000000
>   count=sem->count
>   MB
>                                    sem->count=0xFFFFFFFE00000001
>                                              -0xFFFFFFFF00000001
>                                    RMB

This doesn't make sense, it appears to order a STORE against something
else.

>                                    spin_trylock(wait_lock)
>                                    return
>  rwsem_try_write_lock(count)
>  spin_unlock(wait_lock)
>  schedule()

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


Thread

[PATCH] rwsem: fix missed wakeup due to reordering of load Prateek Sood <prsood@codeaurora.org> - 2017-08-23 13:30 +0200
  Re: [PATCH] rwsem: fix missed wakeup due to reordering of load Peter Zijlstra <peterz@infradead.org> - 2017-08-24 13:30 +0200
    Re: [PATCH] rwsem: fix missed wakeup due to reordering of load Peter Zijlstra <peterz@infradead.org> - 2017-08-24 14:40 +0200
      Re: [PATCH] rwsem: fix missed wakeup due to reordering of load Peter Zijlstra <peterz@infradead.org> - 2017-08-24 15:00 +0200

csiph-web