From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936596AbcKONwO (ORCPT ); Tue, 15 Nov 2016 08:52:14 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57938 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936334AbcKONwL (ORCPT ); Tue, 15 Nov 2016 08:52:11 -0500 Subject: Re: [GIT PULL v2 1/5] processor.h: introduce cpu_relax_yield To: Russell King - ARM Linux References: <1477386195-32736-1-git-send-email-borntraeger@de.ibm.com> <1477386195-32736-2-git-send-email-borntraeger@de.ibm.com> <20161115123029.GT1041@n2100.armlinux.org.uk> <7f7850e4-c7bb-9cc1-2d65-a1555e97988a@de.ibm.com> <20161115133758.GV1041@n2100.armlinux.org.uk> Cc: Peter Zijlstra , Ingo Molnar , Nicholas Piggin , linux-kernel@vger.kernel.org, linux-s390 , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Heiko Carstens , Martin Schwidefsky , Noam Camus , sparclinux@vger.kernel.org, x86@kernel.org, Will Deacon , Catalin Marinas , virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org From: Christian Borntraeger Date: Tue, 15 Nov 2016 14:52:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161115133758.GV1041@n2100.armlinux.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111513-0016-0000-0000-000002657147 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111513-0017-0000-0000-000023D06461 Message-Id: <7ebfbdba-02bb-e837-dbce-6a5acaf3a374@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-15_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611150250 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/15/2016 02:37 PM, Russell King - ARM Linux wrote: > On Tue, Nov 15, 2016 at 02:19:53PM +0100, Christian Borntraeger wrote: >> On 11/15/2016 01:30 PM, Russell King - ARM Linux wrote: >>> On Tue, Oct 25, 2016 at 11:03:11AM +0200, Christian Borntraeger wrote: >>>> For spinning loops people do 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 power,sparc64 and arc, cpu_relax can shift the CPU >>>> towards other hardware threads in an SMT environment. >>>> On s390 cpu_relax does even more, it uses an hypercall to the >>>> hypervisor to give up the timeslice. >>>> In contrast to the SMT yielding this can result in larger latencies. >>>> In some places this latency is unwanted, so another variant >>>> "cpu_relax_lowlatency" was introduced. Before this is used in more >>>> and more places, lets revert the logic and provide a cpu_relax_yield >>>> that can be called in places where yielding is more important than >>>> latency. By default this is the same as cpu_relax on all architectures. >>> >>> Rather than having to update all these architectures in this way, can't >>> we put in some linux/*.h header something like: >>> >>> #ifndef cpu_relax_yield >>> #define cpu_relax_yield() cpu_relax() >>> #endif >>> >>> so only those architectures that need to do something need to be >>> modified? >> >> These patches are part of linux-next since a month or so, changing that >> would invalidate all the next testing. If people want that, I can certainly >> do that, though. > > It's three weeks since you posted them. For one of those weeks (the > week you posted them) I was away, and missed them while catching up. > Sorry, but it sometimes takes a while to spot things amongst the > backlog, and normally takes some subsequent activity on the thread to > bring it back into view. Absolutely no need to apologize. Thank you for doing the review and the proposal. I will do whatever is consensus, but since this looks like tip/locking material I will wait for Peter or Ingo to decide about the if and how. Christian From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [GIT PULL v2 1/5] processor.h: introduce cpu_relax_yield Date: Tue, 15 Nov 2016 14:52:03 +0100 Message-ID: <7ebfbdba-02bb-e837-dbce-6a5acaf3a374@de.ibm.com> References: <1477386195-32736-1-git-send-email-borntraeger@de.ibm.com> <1477386195-32736-2-git-send-email-borntraeger@de.ibm.com> <20161115123029.GT1041@n2100.armlinux.org.uk> <7f7850e4-c7bb-9cc1-2d65-a1555e97988a@de.ibm.com> <20161115133758.GV1041@n2100.armlinux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20161115133758.GV1041@n2100.armlinux.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Archive: List-Post: To: Russell King - ARM Linux Cc: linux-arch@vger.kernel.org, linux-s390 , kvm@vger.kernel.org, Peter Zijlstra , Will Deacon , x86@kernel.org, Heiko Carstens , linux-kernel@vger.kernel.org, Nicholas Piggin , virtualization@lists.linux-foundation.org, sparclinux@vger.kernel.org, Noam Camus , Catalin Marinas , Martin Schwidefsky , xen-devel@lists.xenproject.org, linuxppc-dev@lists.ozlabs.org, Ingo Molnar List-ID: On 11/15/2016 02:37 PM, Russell King - ARM Linux wrote: > On Tue, Nov 15, 2016 at 02:19:53PM +0100, Christian Borntraeger wrote: >> On 11/15/2016 01:30 PM, Russell King - ARM Linux wrote: >>> On Tue, Oct 25, 2016 at 11:03:11AM +0200, Christian Borntraeger wrote: >>>> For spinning loops people do 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 power,sparc64 and arc, cpu_relax can shift the CPU >>>> towards other hardware threads in an SMT environment. >>>> On s390 cpu_relax does even more, it uses an hypercall to the >>>> hypervisor to give up the timeslice. >>>> In contrast to the SMT yielding this can result in larger latencies. >>>> In some places this latency is unwanted, so another variant >>>> "cpu_relax_lowlatency" was introduced. Before this is used in more >>>> and more places, lets revert the logic and provide a cpu_relax_yield >>>> that can be called in places where yielding is more important than >>>> latency. By default this is the same as cpu_relax on all architectures. >>> >>> Rather than having to update all these architectures in this way, can't >>> we put in some linux/*.h header something like: >>> >>> #ifndef cpu_relax_yield >>> #define cpu_relax_yield() cpu_relax() >>> #endif >>> >>> so only those architectures that need to do something need to be >>> modified? >> >> These patches are part of linux-next since a month or so, changing that >> would invalidate all the next testing. If people want that, I can certainly >> do that, though. > > It's three weeks since you posted them. For one of those weeks (the > week you posted them) I was away, and missed them while catching up. > Sorry, but it sometimes takes a while to spot things amongst the > backlog, and normally takes some subsequent activity on the thread to > bring it back into view. Absolutely no need to apologize. Thank you for doing the review and the proposal. I will do whatever is consensus, but since this looks like tip/locking material I will wait for Peter or Ingo to decide about the if and how. Christian From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Date: Tue, 15 Nov 2016 13:52:03 +0000 Subject: Re: [GIT PULL v2 1/5] processor.h: introduce cpu_relax_yield Message-Id: <7ebfbdba-02bb-e837-dbce-6a5acaf3a374@de.ibm.com> List-Id: References: <1477386195-32736-1-git-send-email-borntraeger@de.ibm.com> <1477386195-32736-2-git-send-email-borntraeger@de.ibm.com> <20161115123029.GT1041@n2100.armlinux.org.uk> <7f7850e4-c7bb-9cc1-2d65-a1555e97988a@de.ibm.com> <20161115133758.GV1041@n2100.armlinux.org.uk> In-Reply-To: <20161115133758.GV1041@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Russell King - ARM Linux Cc: linux-arch@vger.kernel.org, linux-s390 , kvm@vger.kernel.org, Peter Zijlstra , Will Deacon , x86@kernel.org, Heiko Carstens , linux-kernel@vger.kernel.org, Nicholas Piggin , virtualization@lists.linux-foundation.org, sparclinux@vger.kernel.org, Noam Camus , Catalin Marinas , Martin Schwidefsky , xen-devel@lists.xenproject.org, linuxppc-dev@lists.ozlabs.org, Ingo Molnar On 11/15/2016 02:37 PM, Russell King - ARM Linux wrote: > On Tue, Nov 15, 2016 at 02:19:53PM +0100, Christian Borntraeger wrote: >> On 11/15/2016 01:30 PM, Russell King - ARM Linux wrote: >>> On Tue, Oct 25, 2016 at 11:03:11AM +0200, Christian Borntraeger wrote: >>>> For spinning loops people do 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 power,sparc64 and arc, cpu_relax can shift the CPU >>>> towards other hardware threads in an SMT environment. >>>> On s390 cpu_relax does even more, it uses an hypercall to the >>>> hypervisor to give up the timeslice. >>>> In contrast to the SMT yielding this can result in larger latencies. >>>> In some places this latency is unwanted, so another variant >>>> "cpu_relax_lowlatency" was introduced. Before this is used in more >>>> and more places, lets revert the logic and provide a cpu_relax_yield >>>> that can be called in places where yielding is more important than >>>> latency. By default this is the same as cpu_relax on all architectures. >>> >>> Rather than having to update all these architectures in this way, can't >>> we put in some linux/*.h header something like: >>> >>> #ifndef cpu_relax_yield >>> #define cpu_relax_yield() cpu_relax() >>> #endif >>> >>> so only those architectures that need to do something need to be >>> modified? >> >> These patches are part of linux-next since a month or so, changing that >> would invalidate all the next testing. If people want that, I can certainly >> do that, though. > > It's three weeks since you posted them. For one of those weeks (the > week you posted them) I was away, and missed them while catching up. > Sorry, but it sometimes takes a while to spot things amongst the > backlog, and normally takes some subsequent activity on the thread to > bring it back into view. Absolutely no need to apologize. Thank you for doing the review and the proposal. I will do whatever is consensus, but since this looks like tip/locking material I will wait for Peter or Ingo to decide about the if and how. Christian