Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753337AbcCYCpI (ORCPT ); Thu, 24 Mar 2016 22:45:08 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:17123 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbcCYCpC (ORCPT ); Thu, 24 Mar 2016 22:45:02 -0400 Date: Fri, 25 Mar 2016 10:40:40 +0800 From: Jisheng Zhang To: Lorenzo Pieralisi CC: Will Deacon , , , , Subject: Re: [PATCH 0/2] arm64: cpuidle: make arm_cpuidle_suspend() more efficient Message-ID: <20160325104040.31dfe855@xhacker> In-Reply-To: <20160324164419.GB21749@red-moon> References: <1458796130-6109-1-git-send-email-jszhang@marvell.com> <20160324111507.GB9323@arm.com> <20160324211853.1ffebd49@xhacker> <20160324164419.GB21749@red-moon> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-03-25_01:,, signatures=0 X-Proofpoint-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-1601100000 definitions=main-1603250039 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2434 Lines: 78 Hi Lorenzo, On Thu, 24 Mar 2016 16:44:19 +0000 Lorenzo Pieralisi wrote: > On Thu, Mar 24, 2016 at 09:18:53PM +0800, Jisheng Zhang wrote: > > Hi Will, > > > > On Thu, 24 Mar 2016 11:15:07 +0000 Will Deacon wrote: > > > > > On Thu, Mar 24, 2016 at 01:08:48PM +0800, Jisheng Zhang wrote: > > > > This series is to improve the arm_cpuidle_suspend() a bit by removing/moving > > > > out checks from this hot path. > > > > > > > > Jisheng Zhang (2): > > > > arm64: cpuidle: remove cpu_ops check from arm_cpuidle_suspend() > > > > arm64: cpuidle: make arm_cpuidle_suspend() a bit more efficient > > > > > > > > arch/arm64/kernel/cpuidle.c | 9 ++------- > > > > 1 file changed, 2 insertions(+), 7 deletions(-) > > > > > > These look fine to me, but do you have any rough numbers showing what > > > sort of improvement we get from this change? > > > > Good question. Here it is: > > > > I measured the 4096 * time from arm_cpuidle_suspend entry point to the > > cpu_psci_cpu_suspend entry point. HW platform is Marvell BG4CT STB board. > > > > 1. only one shell, no other process, hot-unplug secondary cpus, execute the > > following cmd > > > > while true > > do > > sleep 0.2 > > done > > > > before the patch: 1581220ns > > > > after the patch: 1579630ns > > > > reduced by 0.1% > > > > 2. only one shell, no other process, hot-unplug secondary cpus, execute the > > following cmd > > > > while true > > do > > md5sum /tmp/testfile > > sleep 0.2 > > done > > > > NOTE the testfile size should be larger than L1+L2 cache size > > > > before the patch: 1961960ns > > after the patch: 1912500ns > > > > reduced by 2.5% > > > > So the more complex the system load, the bigger the improvement. > > So between arm_cpuidle_suspend() and psci_cpu_suspend_enter() the > checks that you are removing are almost the *only* code that is > currently executed and this patch saves us best case 12ns per idle state > entry (which is noise compared to CPU PM notifiers/FW execution time) > if I am not mistaken, I can't wait to use that energy for something more > useful :) > > Anyway, as a clean-up your patches are fine it is sloppy to check those > pointers on every idle state entry (do you really need two patches ?), so: hmm, yes, it makes more sense to combined them into one patch. > > Acked-by: Lorenzo Pieralisi Thanks for reviewing, Jisheng