Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1383428
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() |
| Date | 2016-04-20 16:20 +0200 |
| Message-ID | <rq18Z-K6-1@gated-at.bofh.it> (permalink) |
| References | <rnUv0-6rs-13@gated-at.bofh.it> <rpZ7b-7FX-3@gated-at.bofh.it> <rq18Z-K6-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() Peter Zijlstra <peterz@infradead.org> - 2016-04-20 14:10 +0200
Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() Peter Zijlstra <peterz@infradead.org> - 2016-04-20 16:20 +0200
Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() Pan Xinhui <xinhui@linux.vnet.ibm.com> - 2016-04-20 16:40 +0200
Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() Waiman Long <waiman.long@hpe.com> - 2016-04-20 20:00 +0200
Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() Waiman Long <waiman.long@hpe.com> - 2016-04-20 20:00 +0200
Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() Pan Xinhui <xinhui@linux.vnet.ibm.com> - 2016-04-20 16:20 +0200
Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() Peter Zijlstra <peterz@infradead.org> - 2016-04-20 16:20 +0200
Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() Pan Xinhui <xinhui@linux.vnet.ibm.com> - 2016-04-20 17:10 +0200
Re: [PATCH v2] locking/pvqspinlock: Add lock holder CPU argument to pv_wait() Waiman Long <waiman.long@hpe.com> - 2016-04-20 19:50 +0200
csiph-web