From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF4ECC636CC for ; Mon, 30 Jan 2023 09:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235773AbjA3JwP (ORCPT ); Mon, 30 Jan 2023 04:52:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235379AbjA3JwA (ORCPT ); Mon, 30 Jan 2023 04:52:00 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F13271ADC4; Mon, 30 Jan 2023 01:51:58 -0800 (PST) Date: Mon, 30 Jan 2023 10:51:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1675072317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ggXzOd89KFIJ6f1Z/pzLBaiL5Q7ZJjEjXvd8xWV2nzU=; b=VpWek9Ux8EZCxRl1fPnM/nYNPO8LtDFiW+1qx1+tbuB75IFPhOdou8ttS9e46NW2B9AiOt LZooVbcNZb7C3VA/HLYCCyEOEK2cfeXBnV4feP1TyOWazhZANpd3qCHgZ7V5+7nP5KTcJ3 6L0rwDRmju44/bbDWCZzazhmvNwD86MCEUnlkp21ml1BxCCKcqiIfQjbE+Bez/V6mTCbdd TDl+EbS4YOayo7U8w0umHPdlPFZNl+OKjRUhadTI2fZdqrZnDNbSZjxJ0ckl1qG4C1WwWj RLoKdEYyTi9jbNf0brhKBTxZgpBl0zTB+uqBy0nr22raqES1HcPwgFxf+15Thg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1675072317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ggXzOd89KFIJ6f1Z/pzLBaiL5Q7ZJjEjXvd8xWV2nzU=; b=QkkwBZL0cnvBXkl91/Am3GwV3LcF27qm7o5EX57ibxgJlxPb1yxZzV9c5CHz7iPHEj8usb RWe0HhRUF++4cXBA== From: Sebastian Andrzej Siewior To: Krzysztof Kozlowski Cc: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Kevin Hilman , Ulf Hansson , Daniel Lezcano , Lorenzo Pieralisi , Sudeep Holla , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Adrien Thierry , Brian Masney , linux-rt-users@vger.kernel.org Subject: Re: [PATCH v2 3/5] cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT Message-ID: References: <20221219151503.385816-1-krzysztof.kozlowski@linaro.org> <20221219151503.385816-4-krzysztof.kozlowski@linaro.org> <3d7c3a52-baa4-ce7b-e6d1-06a4d885d445@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3d7c3a52-baa4-ce7b-e6d1-06a4d885d445@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-01-12 12:34:35 [+0100], Krzysztof Kozlowski wrote: > On 12/01/2023 12:09, Sebastian Andrzej Siewior wrote: > > On 2022-12-19 16:15:01 [+0100], Krzysztof Kozlowski wrote: > >> diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c > >> index 57bc3e3ae391..9d971cc4b12b 100644 > >> --- a/drivers/cpuidle/cpuidle-psci.c > >> +++ b/drivers/cpuidle/cpuidle-psci.c > >> @@ -72,7 +72,7 @@ static int __psci_enter_domain_idle_state(struct cpuidle_device *dev, > >> ct_irq_enter_irqson(); > >> if (s2idle) > >> dev_pm_genpd_suspend(pd_dev); > >> - else > >> + else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) > >> pm_runtime_put_sync_suspend(pd_dev); > > > > So based on the commit description you run into a sleeping lock in > > pm_runtime_put_sync_suspend() while the CPU is in an IRQ-off region. > > Why is it okay to skip it on PREEMPT_RT? > > It is okay to skip it everywhere, you just don't get a suspended CPU. > Why PREEMPT_RT is different here - having suspended CPU is a great way > to have longer or even unpredictable (as it goes to firmware which is > out of control of Linux) latencies. On X86 C1 has a latency of less than 5us and this is exposed by the firmware. C1E and everything that follows has a much higher entry/ exit latency which makes not usable. The entry/exit latency seems not to be exposed by PSCI. My understanding is that the driver is now enabled but not doing any suspending, right? If so, why isn't it completely disabled? > Best regards, > Krzysztof Sebastian From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65FD7C61DA4 for ; Mon, 30 Jan 2023 09:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JpQI5bzxspvf2+VuQdVwdJuUUJNSiklbOU78DAJjUdM=; b=Bw+6bXPiaHvrW5 7NECexoch0jdpW2sdJE4NvzLLxMbD3KKDCdfcixYExNJkwRh9Xl2Mft2yRVLS/jDwEpefsp9RPXRB TyJ3PgZLvPua7AXzWlwimz28TbFntFkzKLhv/yo2qQzNwjvD2WFjKLCoCU24x56I8D6XgSWf20Gxg z9DmdLRW5aJ6N9d62EjX9jz8uTvS05Bmk9ziIzBLAk4npbLePOQSDkugFlKjj9tzmCGFTq9DkUxR2 VLMz8jITOBafNf2X89QqycqkBP9tg2KNH36O3NlDc5MSvRtoXGb55zhiTl3VVfml+qXYEEzXEyTWW xuY/sd/MkN6cmxZugALw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMQqR-002ydb-VM; Mon, 30 Jan 2023 09:53:00 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMQpi-002ycp-Gd for linux-arm-kernel@bombadil.infradead.org; Mon, 30 Jan 2023 09:52:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ggXzOd89KFIJ6f1Z/pzLBaiL5Q7ZJjEjXvd8xWV2nzU=; b=htO2o1Mg7iR+5h/ZPzTcluRgHk M/zPrIU5LwPPBil75PaCq4K5FfCsKEJDPn6aCu4MRZtn9hUxhniFJ5ns6JQG0FGwWRkBaTbtTSsDg 6ma+EV7oZPqN0tgxje5S8G/fHDiJwMTO1BMYNL5DDZvQ+PTGoG0JM+GhrcIk7jOoy3e/feJ+/SMi/ zhYuXW69/M3JV5cKBRjQHfPWWeg2cTvKAZzTAwxjl5brDaSqSAgRlETgUr56WZS6qZaP2ddMWxOFX 9QWH8tdAn4btlg0WT6eOT+hrNJ0T7AdRZy8w/skEohjxjQ+4m3TnY/blHASAgVC0H0OEd4N40AJH9 FiNEZCEA==; Received: from galois.linutronix.de ([193.142.43.55]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pMQp7-003t48-0r for linux-arm-kernel@lists.infradead.org; Mon, 30 Jan 2023 09:51:39 +0000 Date: Mon, 30 Jan 2023 10:51:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1675072317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ggXzOd89KFIJ6f1Z/pzLBaiL5Q7ZJjEjXvd8xWV2nzU=; b=VpWek9Ux8EZCxRl1fPnM/nYNPO8LtDFiW+1qx1+tbuB75IFPhOdou8ttS9e46NW2B9AiOt LZooVbcNZb7C3VA/HLYCCyEOEK2cfeXBnV4feP1TyOWazhZANpd3qCHgZ7V5+7nP5KTcJ3 6L0rwDRmju44/bbDWCZzazhmvNwD86MCEUnlkp21ml1BxCCKcqiIfQjbE+Bez/V6mTCbdd TDl+EbS4YOayo7U8w0umHPdlPFZNl+OKjRUhadTI2fZdqrZnDNbSZjxJ0ckl1qG4C1WwWj RLoKdEYyTi9jbNf0brhKBTxZgpBl0zTB+uqBy0nr22raqES1HcPwgFxf+15Thg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1675072317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ggXzOd89KFIJ6f1Z/pzLBaiL5Q7ZJjEjXvd8xWV2nzU=; b=QkkwBZL0cnvBXkl91/Am3GwV3LcF27qm7o5EX57ibxgJlxPb1yxZzV9c5CHz7iPHEj8usb RWe0HhRUF++4cXBA== From: Sebastian Andrzej Siewior To: Krzysztof Kozlowski Cc: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , Kevin Hilman , Ulf Hansson , Daniel Lezcano , Lorenzo Pieralisi , Sudeep Holla , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Adrien Thierry , Brian Masney , linux-rt-users@vger.kernel.org Subject: Re: [PATCH v2 3/5] cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT Message-ID: References: <20221219151503.385816-1-krzysztof.kozlowski@linaro.org> <20221219151503.385816-4-krzysztof.kozlowski@linaro.org> <3d7c3a52-baa4-ce7b-e6d1-06a4d885d445@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3d7c3a52-baa4-ce7b-e6d1-06a4d885d445@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230130_095137_514605_B1F4F035 X-CRM114-Status: GOOD ( 16.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2023-01-12 12:34:35 [+0100], Krzysztof Kozlowski wrote: > On 12/01/2023 12:09, Sebastian Andrzej Siewior wrote: > > On 2022-12-19 16:15:01 [+0100], Krzysztof Kozlowski wrote: > >> diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c > >> index 57bc3e3ae391..9d971cc4b12b 100644 > >> --- a/drivers/cpuidle/cpuidle-psci.c > >> +++ b/drivers/cpuidle/cpuidle-psci.c > >> @@ -72,7 +72,7 @@ static int __psci_enter_domain_idle_state(struct cpuidle_device *dev, > >> ct_irq_enter_irqson(); > >> if (s2idle) > >> dev_pm_genpd_suspend(pd_dev); > >> - else > >> + else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) > >> pm_runtime_put_sync_suspend(pd_dev); > > > > So based on the commit description you run into a sleeping lock in > > pm_runtime_put_sync_suspend() while the CPU is in an IRQ-off region. > > Why is it okay to skip it on PREEMPT_RT? > > It is okay to skip it everywhere, you just don't get a suspended CPU. > Why PREEMPT_RT is different here - having suspended CPU is a great way > to have longer or even unpredictable (as it goes to firmware which is > out of control of Linux) latencies. On X86 C1 has a latency of less than 5us and this is exposed by the firmware. C1E and everything that follows has a much higher entry/ exit latency which makes not usable. The entry/exit latency seems not to be exposed by PSCI. My understanding is that the driver is now enabled but not doing any suspending, right? If so, why isn't it completely disabled? > Best regards, > Krzysztof Sebastian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel