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 X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0FD0C433E1 for ; Wed, 27 May 2020 15:04:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 806CC207CB for ; Wed, 27 May 2020 15:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590591848; bh=5Vx58Hq7sHLXBsQGSYl+3QZFOqiNWHmAX7GPof+o7eQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=enDS5qx5Cl3IupxkyMEuc2cbbgE+TU5sDxRfXoxkAWzXAbYqamk46UsMVEvfgU4Wu lcry7llPNStpMYhSj4Poj+zA4ch6wJxS4+UjQHvAC4dgwl00749mRbf7pkn4LywYWP m6iolpcDLbwHrUfacfwwY+jDiadmrr0pJLoNJIkM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389535AbgE0PEI (ORCPT ); Wed, 27 May 2020 11:04:08 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:44167 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388922AbgE0PEF (ORCPT ); Wed, 27 May 2020 11:04:05 -0400 Received: by mail-ot1-f67.google.com with SMTP id f18so19381794otq.11; Wed, 27 May 2020 08:04:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5Vx58Hq7sHLXBsQGSYl+3QZFOqiNWHmAX7GPof+o7eQ=; b=RPNRGy3RVD/8p8fIS/e71D1IzKwwT4JtFTrm+9lC/39N5oDVv48rysacQmI6AmEc0m 3w5UTJ+iK/gdHOuIgFP/gtFpyWpP0wbVZCIbsEpT6UHN2M2vLki4/LyIBAVsP/0LsdsK bAWezmc21ocmBiJRM12Zwxa8XKiFSovo1HnPZAmARVo/PJIB2GPTe4hCuFGiB1It6jKu IeZN7xuwvAw5rSuUZVeDEEYZQKPgPxhkbpIemItMRjxrE/PUtos40b4sWDmJXNO9Knqt Tzsk464l6sECog1uDQqAsyK5/tTyOzvSOpGG3jmKABi2ZeyfOIWFfOdl+Xffd1EIq57T A27Q== X-Gm-Message-State: AOAM533q0gyFdGO7ekckdz3fm/enUSJCCyHIxy1XGwZFLpIag6VHdc3p o2C66z/zAwxAkAGZ41kL5kH/uO0AQ2j97OcfaVM= X-Google-Smtp-Source: ABdhPJzwMPGSTgdrUYctj0XU40med+NR1Bq/ddfSHu6e0BLAm4f5O93pxTTndqvUHsxmhkX1InI0IHrV5NKDuiWzbv8= X-Received: by 2002:a9d:4713:: with SMTP id a19mr4711281otf.167.1590591844210; Wed, 27 May 2020 08:04:04 -0700 (PDT) MIME-Version: 1.0 References: <20200526151619.8779-1-benjamin.gaignard@st.com> <51917583-f8ff-3933-7783-2eedc91484a4@st.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 27 May 2020 17:03:52 +0200 Message-ID: Subject: Re: [RFC RESEND 0/3] Introduce cpufreq minimum load QoS To: Benjamin GAIGNARD Cc: Vincent Guittot , Valentin Schneider , "rjw@rjwysocki.net" , "viresh.kumar@linaro.org" , Hugues FRUCHET , "mchehab@kernel.org" , "mcoquelin.stm32@gmail.com" , Alexandre TORGUE , "pavel@ucw.cz" , "len.brown@intel.com" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-media@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 4:54 PM Benjamin GAIGNARD wrote: > > > > On 5/27/20 2:48 PM, Benjamin GAIGNARD wrote: > > > > > > On 5/27/20 2:22 PM, Vincent Guittot wrote: > >> On Wed, 27 May 2020 at 13:17, Benjamin GAIGNARD > >> wrote: > >>> > >>> > >>> On 5/27/20 12:09 PM, Valentin Schneider wrote: > >>>> Hi Benjamin, > >>>> > >>>> On 26/05/20 16:16, Benjamin Gaignard wrote: > >>>>> A first round [1] of discussions and suggestions have already be > >>>>> done on > >>>>> this series but without found a solution to the problem. I resend > >>>>> it to > >>>>> progress on this topic. > >>>>> > >>>> Apologies for sleeping on that previous thread. > >>>> > >>>> So what had been suggested over there was to use uclamp to boost the > >>>> frequency of the handling thread; however if you use threaded IRQs you > >>>> get RT threads, which already get the max frequency by default (at > >>>> least > >>>> with schedutil). > >>>> > >>>> Does that not work for you, and if so, why? > >>> That doesn't work because almost everything is done by the hardware > >>> blocks > >>> without charge the CPU so the thread isn't running. I have done the > >>> tests with schedutil > >>> and ondemand scheduler (which is the one I'm targeting). I have no > >>> issues when using > >>> performance scheduler because it always keep the highest frequencies. > >> IMHO, the only way to ensure a min frequency for anything else than a > >> thread is to use freq_qos_add_request() just like cpufreq cooling > >> device but for the opposite QoS. This can be applied only on the > >> frequency domain of the CPU which handles the interrupt. > > I will give a try with this idea. > > Thanks. > > Adding freq_qos_add_request(FREQ_QOS_MIN) when starting streaming frames > solve my problem. I remove the request at the end of the streaming to > restore > the default value. You may as well add the request once at the init time with the request value set to PM_QOS_MIN_FREQUENCY_DEFAULT_VALUE initially and update it as needed going forward. 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 X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B307C433E1 for ; Wed, 27 May 2020 15:04:18 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 18096207CB for ; Wed, 27 May 2020 15:04:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tdR73Zln" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18096207CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wPhbg6x2oMyLO+KNAq2Jip5YrzwJM5WMlxxI/8TRjrs=; b=tdR73Zln8HITV8 e/rV4r57OWcdcwZbqWApNOGqryIFGHg4iEGn6PmZJPmq1poz16rkZkfjjCZpz7tapuhhmN1TzPKGp SKUVuemzniYTGIyBme6uHjP6OhhvRmz1XK05JsBy+RtRagdZcLvNZFSWON8Gavv9hC0uHa4dIW4XC aBc7D1vw3hVdBowpYFsFQTy1Kit0YVNbbDZVR+GMRwQrFxsdrsREPJhI0zt8oo75aYkKSLwTwCJ/O xr+yo9m06SKi3dB2AgWpskVzHLPMjv0ZrDgGs5md+BkmCU0PUG4i1Rblu4o1St7QJL+HsFLKFouXu Kc7vjPJe9KOx+XUn3ryQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdxbN-0008SE-65; Wed, 27 May 2020 15:04:17 +0000 Received: from mail-ot1-f67.google.com ([209.85.210.67]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdxbB-0008Hw-HP for linux-arm-kernel@lists.infradead.org; Wed, 27 May 2020 15:04:06 +0000 Received: by mail-ot1-f67.google.com with SMTP id c3so19349840otr.12 for ; Wed, 27 May 2020 08:04:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5Vx58Hq7sHLXBsQGSYl+3QZFOqiNWHmAX7GPof+o7eQ=; b=g+HgY4r86+l1mWDrdFFw5TGkpOFYjQ2TaPnYlnrxm4UXUwsoPPRH0mDlos/hSKvf6F SGNKZhXnFZGRNlUR1E2vQBKVIN+M1TDpkuT0s5AcEHF9zCwqBmKmbkRVW6c6fvZRbk/l aKY6fSQ3jKLox/dKqYY8gso+LMdTlC28mYFv0Q8OzAplf8T028ISrZw4nj5eJfx/KnHC QnZwNb2LczUiEbmGnYrNTPsefyOlVT23WkgY+LvQGN9a4XOGz/oG/u2YPU40+v7V1CNt eKBFq0A4GCsD619Ial8zIXSBV44ZudlEpA97D4cbnVOImNJtCrLaI/VZwgiO0j7/k85g x+LA== X-Gm-Message-State: AOAM5333+dcEQBGLbc5INIsHhpf8scJOse+cYweDNA73bQ/MPMhbV6XU lpJCrG9s7hhw/TMg73kWMzJTyr4i5u0XLcjFClk= X-Google-Smtp-Source: ABdhPJzwMPGSTgdrUYctj0XU40med+NR1Bq/ddfSHu6e0BLAm4f5O93pxTTndqvUHsxmhkX1InI0IHrV5NKDuiWzbv8= X-Received: by 2002:a9d:4713:: with SMTP id a19mr4711281otf.167.1590591844210; Wed, 27 May 2020 08:04:04 -0700 (PDT) MIME-Version: 1.0 References: <20200526151619.8779-1-benjamin.gaignard@st.com> <51917583-f8ff-3933-7783-2eedc91484a4@st.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 27 May 2020 17:03:52 +0200 Message-ID: Subject: Re: [RFC RESEND 0/3] Introduce cpufreq minimum load QoS To: Benjamin GAIGNARD X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200527_080405_573643_A76606D1 X-CRM114-Status: GOOD ( 19.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "len.brown@intel.com" , Alexandre TORGUE , "linux-pm@vger.kernel.org" , "viresh.kumar@linaro.org" , "pavel@ucw.cz" , "rjw@rjwysocki.net" , "linux-kernel@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "mcoquelin.stm32@gmail.com" , Hugues FRUCHET , "mchehab@kernel.org" , Valentin Schneider , "linux-arm-kernel@lists.infradead.org" , "linux-media@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 27, 2020 at 4:54 PM Benjamin GAIGNARD wrote: > > > > On 5/27/20 2:48 PM, Benjamin GAIGNARD wrote: > > > > > > On 5/27/20 2:22 PM, Vincent Guittot wrote: > >> On Wed, 27 May 2020 at 13:17, Benjamin GAIGNARD > >> wrote: > >>> > >>> > >>> On 5/27/20 12:09 PM, Valentin Schneider wrote: > >>>> Hi Benjamin, > >>>> > >>>> On 26/05/20 16:16, Benjamin Gaignard wrote: > >>>>> A first round [1] of discussions and suggestions have already be > >>>>> done on > >>>>> this series but without found a solution to the problem. I resend > >>>>> it to > >>>>> progress on this topic. > >>>>> > >>>> Apologies for sleeping on that previous thread. > >>>> > >>>> So what had been suggested over there was to use uclamp to boost the > >>>> frequency of the handling thread; however if you use threaded IRQs you > >>>> get RT threads, which already get the max frequency by default (at > >>>> least > >>>> with schedutil). > >>>> > >>>> Does that not work for you, and if so, why? > >>> That doesn't work because almost everything is done by the hardware > >>> blocks > >>> without charge the CPU so the thread isn't running. I have done the > >>> tests with schedutil > >>> and ondemand scheduler (which is the one I'm targeting). I have no > >>> issues when using > >>> performance scheduler because it always keep the highest frequencies. > >> IMHO, the only way to ensure a min frequency for anything else than a > >> thread is to use freq_qos_add_request() just like cpufreq cooling > >> device but for the opposite QoS. This can be applied only on the > >> frequency domain of the CPU which handles the interrupt. > > I will give a try with this idea. > > Thanks. > > Adding freq_qos_add_request(FREQ_QOS_MIN) when starting streaming frames > solve my problem. I remove the request at the end of the streaming to > restore > the default value. You may as well add the request once at the init time with the request value set to PM_QOS_MIN_FREQUENCY_DEFAULT_VALUE initially and update it as needed going forward. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel