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=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 1F9F1C433DF for ; Wed, 20 May 2020 07:29:57 +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 CED4F207D3 for ; Wed, 20 May 2020 07:29:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rWQY7qAF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=st.com header.i=@st.com header.b="cdQjBZ/m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CED4F207D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=st.com 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:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Vnwtd3hzKC0UL/DoQdJlmTrDuON8SXU7zJX/Lv6BYiM=; b=rWQY7qAFoGtGkJ VpB8iqDz2Ce7OdaOqecGfIQIbwpoTwkNzEcD4KXZUSu4kWcO2ctwNfES6Yu/t+QP5Gs9srvKjMrRt dVY/oj1V+1oqiOmf+q0bE1zoLbHwKOXWy+rR6XD2dP1ofANdeI2ibLf2bMRbiR1Dn9gk14AjeY060 yGHc636XQZwIQQ8geK6+I4Z/If8uKznxBDpUOEfdhxO0OpN+zLjaAWIYazZzFDOl5pGjHcxR7HyTA 9bebZNInv6G/HAl8mhKSvqD9/Q7OsajGQjlGTka+IjTutu4HgllIhld6KcLd+YwN6WaceJEhyA5T8 Z4olG8R72FMgW981Q8NA==; 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 1jbJAq-0007XI-BP; Wed, 20 May 2020 07:29:56 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbJAm-0007Wd-HE for linux-arm-kernel@lists.infradead.org; Wed, 20 May 2020 07:29:54 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04K7R4l3030676; Wed, 20 May 2020 09:29:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=STMicroelectronics; bh=IMRVBLQ0AEUt0XOltEpT6Zor4zCeIp6mr6TUQS8qvRQ=; b=cdQjBZ/mX2n0JEfCgWFNEi0Ys1CBifFs7JeGaa4gCl4dwiy0eMdj61dfvmS9fcLraH5s edE75o7FWmIQ5Nud6pY5li2Ot+AbIMDDEEXgtkoe4dBXc7L8o8kebSKedmoJ1j1DWgAY TIcLaw/wCBOqpBI/CmtPmWoeEQDPrV4xDBkGVrp0vZKAWZZJGMUVchO/yBpG6BewyJQ9 vqywWLgov7kYS5k/A4PYVSb80GSQk9F2g/rN+6m2760UJUVDjyPOgxs6U4b15a+oU34i OsGmCexT3UhxVJQJvOEvKDWVkEdosH3J696tHqcclxExOITXVvVzd7npEsQ17WEcUBzr uQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 3125n3pn8g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 May 2020 09:29:38 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CC92A10002A; Wed, 20 May 2020 09:29:37 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id AAB032A5671; Wed, 20 May 2020 09:29:37 +0200 (CEST) Received: from SFHDAG3NODE3.st.com (10.75.127.9) by SFHDAG3NODE3.st.com (10.75.127.9) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 20 May 2020 09:29:37 +0200 Received: from SFHDAG3NODE3.st.com ([fe80::3507:b372:7648:476]) by SFHDAG3NODE3.st.com ([fe80::3507:b372:7648:476%20]) with mapi id 15.00.1347.000; Wed, 20 May 2020 09:29:37 +0200 From: Benjamin GAIGNARD To: Valentin Schneider Subject: Re: [Linux-stm32] [RFC 0/3] Introduce cpufreq minimum load QoS Thread-Topic: [Linux-stm32] [RFC 0/3] Introduce cpufreq minimum load QoS Thread-Index: AQHWGi06wBgeAQBseECYOK/U7Qvw76iQJdAAgAACCYCAAAQ3AIABBseAgAAT0wCAAE7QgIAADU2AgAARzICAAAO9AIAF2zaAgBkHbAA= Date: Wed, 20 May 2020 07:29:37 +0000 Message-ID: References: <20200424114058.21199-1-benjamin.gaignard@st.com> <7657495.QyJl4BcWH5@kreacher> <30cdecf9-703a-eb2b-7c2b-f1e21c805add@st.com> <70e743cf-b88e-346a-5114-939b8724c83d@arm.com> <6b5cde14-58b3-045d-9413-223e66b87bf0@st.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.49] Content-ID: MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-20_03:2020-05-19, 2020-05-20 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200520_002953_047182_472E6CAF X-CRM114-Status: GOOD ( 21.61 ) 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" , "mcoquelin.stm32@gmail.com" , "linux-pm@vger.kernel.org" , "viresh.kumar@linaro.org" , "Rafael J. Wysocki" , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" , Patrick Bellasi , "pavel@ucw.cz" , "mchehab@kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "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 5/4/20 11:17 AM, Benjamin GAIGNARD wrote: > > On 4/30/20 5:50 PM, Valentin Schneider wrote: >> On 30/04/20 16:37, Benjamin GAIGNARD wrote: >>> On 4/30/20 4:33 PM, Valentin Schneider wrote: >>>> On 30/04/20 14:46, Benjamin GAIGNARD wrote: >>>>>> That's not what I meant. >>>>>> >>>>>> I suppose that the interrupt processing in question takes place in >>>>>> process context and so you may set the lower clamp on the utilization >>>>>> of the task carrying that out. >>>>> I have try to add this code when starting streaming (before the first >>>>> interrupt) the frames from the sensor: >>>>> const struct sched_attr sched_attr = { >>>>> .sched_util_min = 10000, /* 100% of usage */ >>>> Unless you play with SCHED_CAPACITY_SHIFT, the max should be 1024 - >>>> i.e. SCHED_CAPACITY_SCALE. That's a really big boost, but that's for you to >>>> benchmark. >>>> >>>>> .sched_flags = SCHED_FLAG_UTIL_CLAMP_MIN, >>>>> }; >>>>> >>>>> sched_setattr(current, &sched_attr); >>>>> >>>>> I don't see any benefices maybe there is some configuration flags to set. >>>>> >>>>> How changing sched_util_min could impact cpufreq ondemand governor ? >>>>> Does it change the value returned when the governor check the idle time ? >>>>> >>>> You'll have to use the schedutil governor for uclamp to have an effect. And >>>> arguably that's what you should be using, unless something explicitly >>>> prevents you from doing that. >>> Even with schedutil and SCHED_CAPACITY_SCALE that it doesn't work. >>> cpufreq/cpuinfo_cur_freq values are always on the max value even if the >>> stats show transitions between the available frequencies. >>> >>> I see two possibles reasons to explain that: >>> - sched_setattr() is called in userland process context, but the >>> threaded irq handler is running in another process. >> Ah yes, this only works if the task you boost is the one that will handle >> whatever work you care about (in this case handling the irq). That said, if >> you do use threaded IRQs, that should give you a SCHED_FIFO thread, which >> should drive the frequency to its max when using schedutil (unrelated to >> uclamp). > Can I conclude that sched_setattr() isn't the good way to solve this > problem ? > Does my patches make sense in this case ? Gentle up on this series beacause I haven't found any other way to solve this problem. Thanks, Benjamin > >>> - because this use case is almost running all in hardware the process >>> isn't doing anything so the scheduler doesn't take care of it. >>> >>>>>> Alternatively, that task may be a deadline one. > _______________________________________________ > Linux-stm32 mailing list > Linux-stm32@st-md-mailman.stormreply.com > https://st-md-mailman.stormreply.com/mailman/listinfo/linux-stm32 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel