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


Groups > linux.kernel > #1444009

Re: [PATCH v3] locking/pvqspinlock: restore/set vcpu_hashed state after failing adaptive locking spinning

From Wanpeng Li <kernellwp@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3] locking/pvqspinlock: restore/set vcpu_hashed state after failing adaptive locking spinning
Date 2016-07-15 09:50 +0200
Message-ID <rV62K-47o-1@gated-at.bofh.it> (permalink)
References <rUN9M-G3-27@gated-at.bofh.it> <rUWmJ-6sk-3@gated-at.bofh.it> <rUWmJ-6sk-1@gated-at.bofh.it> <rV5q2-3U6-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-07-15 15:09 GMT+08:00 Peter Zijlstra <peterz@infradead.org>:
> On Fri, Jul 15, 2016 at 05:26:40AM +0800, Wanpeng Li wrote:
>> 2016-07-14 22:52 GMT+08:00 Waiman Long <waiman.long@hpe.com>:
>> [...]
>> > As pv_kick_node() is called immediately after designating the next node as
>> > the queue head, the chance of this racing is possible, but is not likely
>> > unless the lock holder vCPU gets preempted for a long time at that right
>> > moment. This change does not do any harm though, so I am OK with that.
>> > However, I do want you to add a comment about the possible race in the code
>> > as it isn't that obvious or likely.
>>
>> How about something like:
>>
>> /*
>>  * If the lock holder vCPU gets preempted for a long time, pv_kick_node will
>>  * advance its state and hash the lock, restore/set the vcpu_hashed state to
>>  * avoid the race.
>>  */
>
> So I'm not sure. Yes it was a bug, but its fairly 'obvious' it should be

I believe Waiman can give a better comments. :)

> vcpu_hashed, we did after all hash the thing.
>
>> Btw, do you think patch title should be improved, what do you like?
>
> I changed it to: "locking/pvqspinlock: Fix double hash race"

Thanks. :)

Regards,
Wanpeng Li

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


Thread

[PATCH v3] locking/pvqspinlock: restore/set vcpu_hashed state after failing adaptive locking spinning Wanpeng Li <kernellwp@gmail.com> - 2016-07-14 13:40 +0200
  Re: [PATCH v3] locking/pvqspinlock: restore/set vcpu_hashed state  after failing adaptive locking spinning Wanpeng Li <kernellwp@gmail.com> - 2016-07-14 23:30 +0200
    Re: [PATCH v3] locking/pvqspinlock: restore/set vcpu_hashed state  after failing adaptive locking spinning Peter Zijlstra <peterz@infradead.org> - 2016-07-15 09:10 +0200
      Re: [PATCH v3] locking/pvqspinlock: restore/set vcpu_hashed state  after failing adaptive locking spinning Wanpeng Li <kernellwp@gmail.com> - 2016-07-15 09:50 +0200
        Re: [PATCH v3] locking/pvqspinlock: restore/set vcpu_hashed state  after failing adaptive locking spinning Wanpeng Li <kernellwp@gmail.com> - 2016-07-16 03:20 +0200

csiph-web