From: Peter Zijlstra <peterz@infradead.org>
To: Pan Xinhui <xinhui@linux.vnet.ibm.com>
Cc: Waiman Long <Waiman.Long@hpe.com>, Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org,
Scott J Norton <scott.norton@hpe.com>,
Douglas Hatch <doug.hatch@hpe.com>
Subject: Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait()
Date: Wed, 20 Apr 2016 16:19:49 +0200 [thread overview]
Message-ID: <20160420141949.GE3430@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <57178EED.1060207@linux.vnet.ibm.com>
On Wed, Apr 20, 2016 at 10:15:09PM +0800, Pan Xinhui wrote:
> So there is such case that we search the whole hashtable and the lock is not found. :(
> Waiman assume that if l = null, the lock is not stored. however the lock might be there actually.
> But to avoid the worst case I just mentioned above, it can quickly finish the lookup.
> >> +
> >> + /*
> >> + * We try to locate the queue head pv_node by looking
> >> + * up the hash table. If it is not found, use the
> >> + * CPU in the previous node instead.
> >> + */
> >> + hn = pv_lookup_hash(lock);
> >> + if (!hn)
> >> + hn = pn;
> >
> > This is potentially expensive... it does not explain why this lookup can
> > fail etc.. nor mentioned that lock stealing caveat.
> >
> Yes, it's expensive. Normally, PPC phyp don't always need the correct
> holder. That means current vcpu can just give up its slice. There is
> one lpar hvcall H_CONFER. I paste some spec below.
Ok, so if we can indeed scan the _entire_ hashtable, then we really
should not have that in common code. That's seriously expensive.
next prev parent reply other threads:[~2016-04-20 14:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 18:41 Waiman Long
2016-04-20 12:08 ` Peter Zijlstra
2016-04-20 14:15 ` Pan Xinhui
2016-04-20 14:18 ` Peter Zijlstra
2016-04-20 15:05 ` Pan Xinhui
2016-04-20 14:19 ` Peter Zijlstra [this message]
2016-04-20 14:36 ` Pan Xinhui
2016-04-20 17:58 ` Waiman Long
2016-04-20 17:50 ` Waiman Long
2016-04-20 17:46 ` Waiman Long
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=20160420141949.GE3430@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=Waiman.Long@hpe.com \
--cc=doug.hatch@hpe.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=scott.norton@hpe.com \
--cc=xinhui@linux.vnet.ibm.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