From: Peter Zijlstra <peterz@infradead.org>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: Waiman Long <waiman.long@hpe.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Wanpeng Li <wanpeng.li@hotmail.com>,
Ingo Molnar <mingo@kernel.org>,
Davidlohr Bueso <dave@stgolabs.net>
Subject: Re: [PATCH v3] locking/pvqspinlock: restore/set vcpu_hashed state after failing adaptive locking spinning
Date: Fri, 15 Jul 2016 09:09:25 +0200 [thread overview]
Message-ID: <20160715070925.GO30154@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CANRm+Cy-cOYPmEbaRFywysxc2vg5BpKR-UXsqzXA-sX1XBVeRw@mail.gmail.com>
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
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"
next prev parent reply other threads:[~2016-07-15 7:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 11:39 Wanpeng Li
2016-07-14 14:52 ` Waiman Long
2016-07-14 21:26 ` Wanpeng Li
2016-07-15 7:09 ` Peter Zijlstra [this message]
2016-07-15 7:45 ` Wanpeng Li
2016-07-15 16:44 ` Waiman Long
2016-07-16 1:12 ` Wanpeng Li
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=20160715070925.GO30154@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=dave@stgolabs.net \
--cc=kernellwp@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=waiman.long@hpe.com \
--cc=wanpeng.li@hotmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome