From patchwork Fri Jan 13 12:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 43263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp244559wrt; Fri, 13 Jan 2023 04:38:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXsLZrwn+rWr5xNa8TDfTas/iUJjZzg8cfhdb1LTW/jBQAN+Hl3ilPZhW77UxHMYme93WFk1 X-Received: by 2002:aa7:d51a:0:b0:479:6c4f:40df with SMTP id y26-20020aa7d51a000000b004796c4f40dfmr71227896edq.18.1673613509778; Fri, 13 Jan 2023 04:38:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613509; cv=none; d=google.com; s=arc-20160816; b=k7yk5OKnhmDGxHYb5+MDimZxnh3QZmqsmrkAaWG91ARI3FiWcJYJIDyFbGXQKL4jSN PjaTIaYQq8isp96twDNp5z3fmkx7FZ9ISIW2Xr2Pm47H2KAEDWP62tsV+smpj22SMXVA NEeykMJ9GAO2iw3Wg/dnuAi7aYoMDI4MAhw4TLj9AU2yE+PHFXzMdQ710uP7Wc94XBlU sI9zKKzajYNckYsjoYX5zX/iCCZoWH1HBnmYRpHPs9BP+qWKgzENpCYRQK+7+JkEor6X AeigGf+VUcvRziwk68VieENcy6hBtJtSe2cdRuM7gUi6wIBY9uRWsoZ6KzRYENG0Ibgk wV4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=IdHvpPSQSZAkV9++SX1Wbo6VK6lNx4oK1LX4BODVDuM=; b=xI/k/Q2pQ2DUQcFs11h4qlvyY7T7lRM/wK1RSZdpHjxIHQTQhiT+NWWRXzS2fFTExA df7C8R/zD+LVWVgArL7BCbH3RA3fRwOL8XPzLo81ldYYuN/80Xb5951XHYrRZuqJgKrf aSOjSY3RAED36XmpWDk15kq+IBsNZBo4HyK2b03ZpX119/PSRf5bauu3hyhPS4mReiEM JaQ09xL4kJH0tpPPnJg9LQ1XQ01khCsBzkKfc9QZM6w86BpNAKRzSdYjOdKkNfoOVlYI ZD3Sx99sckbC63rC0weAUAo87T8tNEoXwiiFm7I89+Tek6heIiW2Mhiiu5+qJmiGIuUB E3Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Rxo3nIFY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xc2-20020a170907074200b0084d1310711fsi22219081ejb.782.2023.01.13.04.38.05; Fri, 13 Jan 2023 04:38:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Rxo3nIFY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241096AbjAMMgv (ORCPT + 99 others); Fri, 13 Jan 2023 07:36:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241306AbjAMMcT (ORCPT ); Fri, 13 Jan 2023 07:32:19 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C4941CB17; Fri, 13 Jan 2023 04:31:16 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:14 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673613074; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IdHvpPSQSZAkV9++SX1Wbo6VK6lNx4oK1LX4BODVDuM=; b=Rxo3nIFYac09XXf1iHPYN0cJtsDJXsUPGperJrvzh8J+Eia5lph4QlZ2kqQoY0TiblV2YZ tHOy/1IeK8l21qXiwtxa57p/D8aLGqUuNRfjHt1W2DV5OqDRgl3wN/Jol8MRX6fqXMMT7z TCmG9LrR9TJezy/8BgIfLLCNZ8r5UkTY+JH2mYMFjO7z8IcimkbxFkLv3F++aqrGYCCXyv Z95TJw9Z4L87Avq0yyZPd2EDQ+CEdhYJpsGGD7G21lVBuuyrdJ+khWbEzXph60GrX1OnKv e9TgX93WHJ27QSpIaRm8TSEsD+cXsZfiqcOyMeRk+AG4bq2Fj3ZQ87iWyfdL4A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673613074; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IdHvpPSQSZAkV9++SX1Wbo6VK6lNx4oK1LX4BODVDuM=; b=m6DjOo2gOAfG1//egqVuiphILBH//iBHWkSNndZhRtD3SZaxq1fasvbWpKtTtNlIKKryBJ C/bGxNl+UFCFbKAg== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] cpuidle, armada: Push RCU-idle into driver Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Tony Lindgren , Ulf Hansson , Frederic Weisbecker , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195539.946630819@infradead.org> References: <20230112195539.946630819@infradead.org> MIME-Version: 1.0 Message-ID: <167361307427.4906.15441555774819619097.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754848544099704985?= X-GMAIL-MSGID: =?utf-8?q?1754910959601107143?= The following commit has been merged into the sched/core branch of tip: Commit-ID: 4ce40e9dbe83153f60d7e4ccd24a1eb4f8264f6a Gitweb: https://git.kernel.org/tip/4ce40e9dbe83153f60d7e4ccd24a1eb4f8264f6a Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:24 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:47:27 +01:00 cpuidle, armada: Push RCU-idle into driver Doing RCU-idle outside the driver, only to then temporarily enable it again before going idle is suboptimal. Notably the cpu_pm_*() calls implicitly re-enable RCU for a bit. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Tony Lindgren Tested-by: Ulf Hansson Reviewed-by: Frederic Weisbecker Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230112195539.946630819@infradead.org --- drivers/cpuidle/cpuidle-mvebu-v7.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c index 01a8569..c9568aa 100644 --- a/drivers/cpuidle/cpuidle-mvebu-v7.c +++ b/drivers/cpuidle/cpuidle-mvebu-v7.c @@ -36,7 +36,10 @@ static int mvebu_v7_enter_idle(struct cpuidle_device *dev, if (drv->states[index].flags & MVEBU_V7_FLAG_DEEP_IDLE) deepidle = true; + ct_idle_enter(); ret = mvebu_v7_cpu_suspend(deepidle); + ct_idle_exit(); + cpu_pm_exit(); if (ret) @@ -49,6 +52,7 @@ static struct cpuidle_driver armadaxp_idle_driver = { .name = "armada_xp_idle", .states[0] = ARM_CPUIDLE_WFI_STATE, .states[1] = { + .flags = CPUIDLE_FLAG_RCU_IDLE, .enter = mvebu_v7_enter_idle, .exit_latency = 100, .power_usage = 50, @@ -57,6 +61,7 @@ static struct cpuidle_driver armadaxp_idle_driver = { .desc = "CPU power down", }, .states[2] = { + .flags = CPUIDLE_FLAG_RCU_IDLE, .enter = mvebu_v7_enter_idle, .exit_latency = 1000, .power_usage = 5, @@ -72,6 +77,7 @@ static struct cpuidle_driver armada370_idle_driver = { .name = "armada_370_idle", .states[0] = ARM_CPUIDLE_WFI_STATE, .states[1] = { + .flags = CPUIDLE_FLAG_RCU_IDLE, .enter = mvebu_v7_enter_idle, .exit_latency = 100, .power_usage = 5, @@ -87,6 +93,7 @@ static struct cpuidle_driver armada38x_idle_driver = { .name = "armada_38x_idle", .states[0] = ARM_CPUIDLE_WFI_STATE, .states[1] = { + .flags = CPUIDLE_FLAG_RCU_IDLE, .enter = mvebu_v7_enter_idle, .exit_latency = 10, .power_usage = 5,