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 4D3FCC54EBD for ; Thu, 12 Jan 2023 11:35:49 +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:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Tgw5q2eWhnO8bT3KBLJ7ixj8u1wep8l1Feh/C0fVo6I=; b=f25J8zRmNvuT1g Hj7Xk1MpljnWT8hZWj8/PxAB8yYW5a1QHHPinL2avZDJqwG3rUfWqnsvA6Ag/IBzjFaVnr3nv2Kzu Ww0DCyJKITPmU9d29oqlb850EXr3CBXMuNSUQv00XaGK2YA7Er0Dl6BmifBiS14YGHxEyA4CkD1eN wXQhwBUBpY8aolqr20qSo1YDEdCpGr0p04kAcACBq8skKeD44tYFugSdTs/9zQREERNWKXJv5+4r3 ppdKtjdU4PvmaYVHar443ixv4YcPF6o24kpgs+CYr9Z0AMtzT2Z/ruhYXuYo+Jzsd08U5m4HczBgD eRJQxm2uiX/ws83+j1Xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFvr5-00Er1W-5c; Thu, 12 Jan 2023 11:34:47 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFvr1-00Eqzr-02 for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2023 11:34:44 +0000 Received: by mail-ed1-x52c.google.com with SMTP id j16so26401818edw.11 for ; Thu, 12 Jan 2023 03:34:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=NPppTKcTJ8osAB1279QFcRRpcaOPzuC1Irm/XHV91xY=; b=nhy1MtVbKfauFFS3BCGLF7FnbflcNjW2sYGIUXqKeSwmc884VZmYAIaidQikvPoP0C Giv5KKFQN1nRKP8a/VRC/S+K1XNFW8VZ/aHF1sfownzPT+GHr4wdIsqNieuEgZvNAesE UY2vfXdMQxbvwC8eVEkUcuA7+zfVihSbqvh/4LFVoEIgmFbF7H5AFCqmUxg+LNTLOTjf zmgJus8v3RTAel2iPynBI0r+TGT5qyyKVOc9bsF25aRkzzBGIziT9qUA1okUGK84fDju bcQ8JuqCC6hC549gXJ4z6fGA7n+xwHyNI4YoAXat4g4IqaOH7tJFTIarLg6g/fFA3F5V HQ4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NPppTKcTJ8osAB1279QFcRRpcaOPzuC1Irm/XHV91xY=; b=lNM96xKb0ntaWnHc5bA1aM1QsT5hf0F9OSF8J6KMINuj+Ll18cLZZJG+Qy+1bT/Rse hNpcuT9Fv2gU8iAzWS7/nD0821GKNbEl1y0oe1hb7BXrE1YHFp72aDnAUHFHSsZ6GKJE fWgZh/C8DlKxfH7VfxnvV65riuOgdXih5t5QmWxOneyvLlFfdVbn/SOYBbbFHBGS2WKh MjfHXgU/FDy6ODKPWl2UBLzMVJZF1aVyRU2305Q90jGQqxBanXVjo7DZJcrnb8nAaMhn JmkNml406jENnu+AxgjhTHlpP3ZccsaiWnrSdQX0/ei1BBhOXBFnIIDlUZv0uzbLLg4t U47Q== X-Gm-Message-State: AFqh2kr3v2iR6jwwwfXBQNcgUklaeTo7jOnhZw3thCOcZoJMOAuHtRLB GdmEOapDY44s6f/8pXqs41DWwg== X-Google-Smtp-Source: AMrXdXvWbW8IAmtnQmlSRkX+6gl0xQtW+r+xOr87zb6PQKvXJ8tr9zg5aJqowtBTnLas0xRFoSASbw== X-Received: by 2002:aa7:c393:0:b0:499:b604:4de6 with SMTP id k19-20020aa7c393000000b00499b6044de6mr11772008edq.25.1673523279003; Thu, 12 Jan 2023 03:34:39 -0800 (PST) Received: from [192.168.1.109] ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id d3-20020aa7d5c3000000b004835bd8dfe5sm7200389eds.35.2023.01.12.03.34.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Jan 2023 03:34:38 -0800 (PST) Message-ID: <3d7c3a52-baa4-ce7b-e6d1-06a4d885d445@linaro.org> Date: Thu, 12 Jan 2023 12:34:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2 3/5] cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT Content-Language: en-US To: Sebastian Andrzej Siewior 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 References: <20221219151503.385816-1-krzysztof.kozlowski@linaro.org> <20221219151503.385816-4-krzysztof.kozlowski@linaro.org> From: Krzysztof Kozlowski In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_033443_528002_447A74D5 X-CRM114-Status: GOOD ( 14.28 ) 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 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. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 94A11C54EBD for ; Thu, 12 Jan 2023 11:44:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231592AbjALLok (ORCPT ); Thu, 12 Jan 2023 06:44:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232187AbjALLn2 (ORCPT ); Thu, 12 Jan 2023 06:43:28 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70A344FD51 for ; Thu, 12 Jan 2023 03:34:40 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id x10so23524569edd.10 for ; Thu, 12 Jan 2023 03:34:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=NPppTKcTJ8osAB1279QFcRRpcaOPzuC1Irm/XHV91xY=; b=nhy1MtVbKfauFFS3BCGLF7FnbflcNjW2sYGIUXqKeSwmc884VZmYAIaidQikvPoP0C Giv5KKFQN1nRKP8a/VRC/S+K1XNFW8VZ/aHF1sfownzPT+GHr4wdIsqNieuEgZvNAesE UY2vfXdMQxbvwC8eVEkUcuA7+zfVihSbqvh/4LFVoEIgmFbF7H5AFCqmUxg+LNTLOTjf zmgJus8v3RTAel2iPynBI0r+TGT5qyyKVOc9bsF25aRkzzBGIziT9qUA1okUGK84fDju bcQ8JuqCC6hC549gXJ4z6fGA7n+xwHyNI4YoAXat4g4IqaOH7tJFTIarLg6g/fFA3F5V HQ4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NPppTKcTJ8osAB1279QFcRRpcaOPzuC1Irm/XHV91xY=; b=UPg2iT0+xpvkZAp6Bt/OLYKDAVueZvLCxxK/UfmWWboXe36wcfb48Bor0/Vp0veMUV pGmw2H2yHUokgfmCCiaMEQTt35sKLFnIoFf8ddm8sAyIkSPukBs/1VGoCupOaln8Zt6R OAZC9z7KBKjbVhqYvLlXDJtdng4UriuXvJW67CthjLpuWHGrWIl4oPRb04By1zuikRLV 3+mejLqiuUhkTeKttqm0uznIQsZlzt37Hg0WGm0x/OPCVkrfKXZViq/0hys7DGegqjsG LjKcYj+netQKbbI6jnpYl8wRiRNBTvfDlUYg7qtzE6pACCIX8AjRRRP2bvDzYLug6kiY 3PnA== X-Gm-Message-State: AFqh2koq+3ePnFGDToWIOU9vkd4uYvyKNFglYdxW1/PtDMRfN//aOOxC 0QALaMxlTfo6057ciLYU3Nw4Vw== X-Google-Smtp-Source: AMrXdXvWbW8IAmtnQmlSRkX+6gl0xQtW+r+xOr87zb6PQKvXJ8tr9zg5aJqowtBTnLas0xRFoSASbw== X-Received: by 2002:aa7:c393:0:b0:499:b604:4de6 with SMTP id k19-20020aa7c393000000b00499b6044de6mr11772008edq.25.1673523279003; Thu, 12 Jan 2023 03:34:39 -0800 (PST) Received: from [192.168.1.109] ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id d3-20020aa7d5c3000000b004835bd8dfe5sm7200389eds.35.2023.01.12.03.34.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Jan 2023 03:34:38 -0800 (PST) Message-ID: <3d7c3a52-baa4-ce7b-e6d1-06a4d885d445@linaro.org> Date: Thu, 12 Jan 2023 12:34:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2 3/5] cpuidle: psci: Do not suspend topology CPUs on PREEMPT_RT Content-Language: en-US To: Sebastian Andrzej Siewior 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 References: <20221219151503.385816-1-krzysztof.kozlowski@linaro.org> <20221219151503.385816-4-krzysztof.kozlowski@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Best regards, Krzysztof