Christian Borntraeger
2016-Oct-21 15:08 UTC
[PATCH/RFC 0/5] cpu_relax: introduce yield, remove lowlatency
On 10/21/2016 04:57 PM, David Miller wrote:> From: Christian Borntraeger <borntraeger at de.ibm.com> > Date: Fri, 21 Oct 2016 13:58:53 +0200 > >> For spinning loops people did often use barrier() or cpu_relax(). >> For most architectures cpu_relax and barrier are the same, but on >> some architectures cpu_relax can add some latency. For example on s390 >> cpu_relax gives up the time slice to the hypervisor. On power cpu_relax >> tries to give some of the CPU to the neighbor threads. To reduce the >> latency another variant cpu_relax_lowlatency was introduced. Before this >> is used in more and more places, lets revert the logic of provide a new >> function cpu_relax_yield that can spend some time and for s390 yields >> the guest CPU. > > Sparc64, fwiw, behaves similarly to powerpc.As sparc currently defines cpu_relax_lowlatency to cpu_relax, this patch set should be a no-op then for sparc, correct? My intend was that cpu_relax should not add a huge latency but can certainly push some cpu power to hardware threads of the same core. This seems to be the case for sparc/power and some arc variants. Christian
David Miller
2016-Oct-21 15:12 UTC
[PATCH/RFC 0/5] cpu_relax: introduce yield, remove lowlatency
From: Christian Borntraeger <borntraeger at de.ibm.com> Date: Fri, 21 Oct 2016 17:08:54 +0200> On 10/21/2016 04:57 PM, David Miller wrote: >> From: Christian Borntraeger <borntraeger at de.ibm.com> >> Date: Fri, 21 Oct 2016 13:58:53 +0200 >> >>> For spinning loops people did often use barrier() or cpu_relax(). >>> For most architectures cpu_relax and barrier are the same, but on >>> some architectures cpu_relax can add some latency. For example on s390 >>> cpu_relax gives up the time slice to the hypervisor. On power cpu_relax >>> tries to give some of the CPU to the neighbor threads. To reduce the >>> latency another variant cpu_relax_lowlatency was introduced. Before this >>> is used in more and more places, lets revert the logic of provide a new >>> function cpu_relax_yield that can spend some time and for s390 yields >>> the guest CPU. >> >> Sparc64, fwiw, behaves similarly to powerpc. > > As sparc currently defines cpu_relax_lowlatency to cpu_relax, this patch set > should be a no-op then for sparc, correct? > > My intend was that cpu_relax should not add a huge latency but can certainly > push some cpu power to hardware threads of the same core. This seems to be > the case for sparc/power and some arc variants.Agreed.
Apparently Analagous Threads
- [PATCH/RFC 0/5] cpu_relax: introduce yield, remove lowlatency
- [GIT PULL v2 0/5] cpu_relax: drop lowlatency, introduce yield
- [GIT PULL v2 0/5] cpu_relax: drop lowlatency, introduce yield
- [GIT PULL v2 1/5] processor.h: introduce cpu_relax_yield
- [GIT PULL v2 1/5] processor.h: introduce cpu_relax_yield