From patchwork Thu Nov 9 00:38:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Prakash, Prashanth" X-Patchwork-Id: 10049855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9E8D602D7 for ; Thu, 9 Nov 2017 00:38:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC5262A70F for ; Thu, 9 Nov 2017 00:38:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0DE62A716; Thu, 9 Nov 2017 00:38:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 554532A70F for ; Thu, 9 Nov 2017 00:38:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752783AbdKIAi5 (ORCPT ); Wed, 8 Nov 2017 19:38:57 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:40402 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752510AbdKIAi5 (ORCPT ); Wed, 8 Nov 2017 19:38:57 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 995F4607B5; Thu, 9 Nov 2017 00:38:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510187936; bh=DY5VSlu17H+08YxP/TQjiW7uX7o64wrdWIAcDCc5Bow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bt1rD2jG8Yu0AZlyaKGDp6fpdNbQhzPz6oj6Q8E6+KZkTQJadtPU0TDkASMEMGcyw rHuaMCy81MwjaKuFHwPswX8Elt07Pl06O1YfviDhxdxRK6QKVAIRHN4qWTshz1TFDk 0QRTYDctvsUtx5xh/TpM1XkKTL8UrgbURFOL34es= Received: from pprakash-lnx.qualcomm.com (unknown [129.46.15.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pprakash@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4E080607B5; Thu, 9 Nov 2017 00:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510187936; bh=DY5VSlu17H+08YxP/TQjiW7uX7o64wrdWIAcDCc5Bow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bt1rD2jG8Yu0AZlyaKGDp6fpdNbQhzPz6oj6Q8E6+KZkTQJadtPU0TDkASMEMGcyw rHuaMCy81MwjaKuFHwPswX8Elt07Pl06O1YfviDhxdxRK6QKVAIRHN4qWTshz1TFDk 0QRTYDctvsUtx5xh/TpM1XkKTL8UrgbURFOL34es= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4E080607B5 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pprakash@codeaurora.org From: Prashanth Prakash To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, rjw@rjwysocki.net, daniel.lezcano@linaro.org, will.deacon@arm.com, catalin.marinas@arm.com, Prashanth Prakash Subject: [PATCH v2 2/2] ARM64 / cpuidle: Use new cpuidle macro for entering retention state Date: Wed, 8 Nov 2017 17:38:42 -0700 Message-Id: <1510187922-8218-3-git-send-email-pprakash@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510187922-8218-1-git-send-email-pprakash@codeaurora.org> References: <1510187922-8218-1-git-send-email-pprakash@codeaurora.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP CPU_PM_CPU_IDLE_ENTER_RETENTION skips calling cpu_pm_enter() and cpu_pm_exit(). By not calling cpu_pm functions in idle entry/exit paths we can reduce the latency involved in entering and exiting the low power idle state. On ARM64 based Qualcomm server platform we measured below overhead for calling cpu_pm_enter and cpu_pm_exit for retention states. workload: stress --hdd #CPUs --hdd-bytes 32M -t 30 Average overhead of cpu_pm_enter - 1.2us Average overhead of cpu_pm_exit - 3.1us Signed-off-by: Prashanth Prakash --- arch/arm64/kernel/cpuidle.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/cpuidle.c b/arch/arm64/kernel/cpuidle.c index fd69108..f2d1381 100644 --- a/arch/arm64/kernel/cpuidle.c +++ b/arch/arm64/kernel/cpuidle.c @@ -47,6 +47,8 @@ int arm_cpuidle_suspend(int index) #include +#define ARM64_LPI_IS_RETENTION_STATE(arch_flags) (!(arch_flags)) + int acpi_processor_ffh_lpi_probe(unsigned int cpu) { return arm_cpuidle_init(cpu); @@ -54,6 +56,10 @@ int acpi_processor_ffh_lpi_probe(unsigned int cpu) int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi) { - return CPU_PM_CPU_IDLE_ENTER(arm_cpuidle_suspend, lpi->index); + if (ARM64_LPI_IS_RETENTION_STATE(lpi->arch_flags)) + return CPU_PM_CPU_IDLE_ENTER_RETENTION(arm_cpuidle_suspend, + lpi->index); + else + return CPU_PM_CPU_IDLE_ENTER(arm_cpuidle_suspend, lpi->index); } #endif