From patchwork Tue Nov 7 17:35:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Prakash, Prashanth" X-Patchwork-Id: 10047061 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 65C076032D for ; Tue, 7 Nov 2017 17:36:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A64A2A296 for ; Tue, 7 Nov 2017 17:36:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DF802A2A8; Tue, 7 Nov 2017 17:36:10 +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 C39E52A2A7 for ; Tue, 7 Nov 2017 17:36:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750792AbdKGRgI (ORCPT ); Tue, 7 Nov 2017 12:36:08 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:55280 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471AbdKGRgG (ORCPT ); Tue, 7 Nov 2017 12:36:06 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D23E6607E4; Tue, 7 Nov 2017 17:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510076165; bh=DY5VSlu17H+08YxP/TQjiW7uX7o64wrdWIAcDCc5Bow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tj68MCKehBB0LT+kOmkaa0FSqguO6/hvC/avTDB6JBoK2H48fx0X9BbK4N2GfY5kl LscV0Fn73ppoNSxn/68b1WfHgaNEnRIhnlvRswrT9j4G2Y1WARBH1xUMMnIAExbDWY 7OkNpiQKEjpiKH9CUrF6xuGApcsToiE/9mUBPC8s= 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 779606077A; Tue, 7 Nov 2017 17:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510076165; bh=DY5VSlu17H+08YxP/TQjiW7uX7o64wrdWIAcDCc5Bow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tj68MCKehBB0LT+kOmkaa0FSqguO6/hvC/avTDB6JBoK2H48fx0X9BbK4N2GfY5kl LscV0Fn73ppoNSxn/68b1WfHgaNEnRIhnlvRswrT9j4G2Y1WARBH1xUMMnIAExbDWY 7OkNpiQKEjpiKH9CUrF6xuGApcsToiE/9mUBPC8s= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 779606077A 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 2/2] ARM64 / cpuidle: Use new cpuidle macro for entering retention state Date: Tue, 7 Nov 2017 10:35:33 -0700 Message-Id: <1510076133-18139-3-git-send-email-pprakash@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510076133-18139-1-git-send-email-pprakash@codeaurora.org> References: <1510076133-18139-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