Received: by 10.213.65.68 with SMTP id h4csp603275imn; Tue, 27 Mar 2018 05:34:02 -0700 (PDT) X-Google-Smtp-Source: AG47ELvxLxwHkTveIFsVe6ly2hjBe4uKE/fv6cdx26h6lpuRp4cOdNKrpCs/SBmNoON3wI8Zvzem X-Received: by 2002:a17:902:158b:: with SMTP id m11-v6mr44614080pla.300.1522154042318; Tue, 27 Mar 2018 05:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522154042; cv=none; d=google.com; s=arc-20160816; b=DYWVVbt1gKExiiutxsFsPsqEoOF600V8ID6kkrNUw9myFe268GR70xl3PIt1k7C1dV wQ731tNQOhpXOXp66osn9dmuEwJxujSBMsePFcU67cy+QbTajk144PzJFz0wMy4ovlMT 2d02qntC3HBeHfWhQnXYYzIlnVUlh28UpviuS1fT52T8h8COLoCIijdrd0XMOOM4wjSQ PBn4dSFiLtr1YPq3imM0QFU0DJ9BgmKgHIupvuZEpcWWauwHktKv3c6LEZYCtK9STP3p YGi3/joJudwWGPYYCKerJgS+KPQVd9Ku1rnXtTun3NkKYtI6b0Q6kLEu6JsLUrMWdR9/ eFZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=9QDac3FKjpcaIZUOYJSMOXWmZBKMoSWhR0BMW+4yrt4=; b=vo3/zj8rJfqY8M4iKo4kGAJ7MzI/iYc3tS3dAHwdqFT2FZ5H9KMGJLW1qkz1aRizVj cEDmK8mqQFxS0ZKbHphgS4X1+J3L/vRGup/4LTm/Ix9dnufC+4WsFAg/RlM4F2vULo5r L5/AVCFjoQQmzdvKnM67EYI5cGNgKGDj7/aXJKId3OzAW6AtRjPSWABSmfAmwWK6NXfc 6azseWeohVt/NrezM1+60OCKiejRgQ52hK9T7+hvdvo8/HzgA8p1K+B7XQlT74p8KE3U 9C2fn8b/wuTrWVM3HIPmTqonS9k59raB1zQJWdFjeBrwxee1SozbFtdkdJz0dRq9ZV8Q EqVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJI7x3EQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f33-v6si1216815plb.585.2018.03.27.05.33.47; Tue, 27 Mar 2018 05:34:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJI7x3EQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752120AbeC0McD (ORCPT + 99 others); Tue, 27 Mar 2018 08:32:03 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35641 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbeC0McB (ORCPT ); Tue, 27 Mar 2018 08:32:01 -0400 Received: by mail-wm0-f65.google.com with SMTP id r82so21512814wme.0 for ; Tue, 27 Mar 2018 05:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9QDac3FKjpcaIZUOYJSMOXWmZBKMoSWhR0BMW+4yrt4=; b=aJI7x3EQvLb3ao1E+TQXiVWl6I7za5CC5kx/gLzeluf/MvPEH7TCSZpF0ckn6G1uDx a4Sh+CWiBNfyd8kIxCdDD0tEs2QcGeVOBmAjPgYaBtdcHlvkaiJEZfIxsKonQIFD6pI2 9VMNr9iHfjMH/TdSC208mIqN2cID5Hd6/3Bt4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9QDac3FKjpcaIZUOYJSMOXWmZBKMoSWhR0BMW+4yrt4=; b=Mk2x5mD2lfWzD4gckUoQETSOUM7n/mDUem9DjaCcL/UMcCDDQr5EvpZ6bQCoB1FPzm rRL/AuKIUxdYq44LGvFmTxNmzA6p+PEHr+rOXWaBhJ1rPA/lBb4N7+7qE/aevdDFEWUN zdM0CFAwwVT6CDvLulJl0x57fda7mDULjKrP0GLd2wRJXXd9zicZgqnCccZfQmzxBB0M Ln5M3/qOk9Xhbxg594LH0Psa2+S3B/E60XHnXNTiN+sVn7IpzkWvnin+8aJnBsCi03bY Q6fsiyd2KbFhMtpcYuelb/9iLuA0ryid/6zMSoZyWpXpfJs+afqcj1I5ATV7gQ9MK/Hs DaHA== X-Gm-Message-State: AElRT7Ec7QQRO+kgPpBxGZy8Ca4QjiN8VCypgs3M9hZZEsm6CURc2E1A FAjHz++aBdqSe4/W/l17ho64cw== X-Received: by 10.80.135.141 with SMTP id a13mr5986922eda.218.1522153919573; Tue, 27 Mar 2018 05:31:59 -0700 (PDT) Received: from ?IPv6:2001:41d0:fe90:b800:b0a9:da92:8c72:d9e2? ([2001:41d0:fe90:b800:b0a9:da92:8c72:d9e2]) by smtp.googlemail.com with ESMTPSA id 94sm823325edk.43.2018.03.27.05.31.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Mar 2018 05:31:58 -0700 (PDT) Subject: Re: [PATCH V2 6/7] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver To: Juri Lelli Cc: Leo Yan , edubezval@gmail.com, kevin.wangtao@linaro.org, vincent.guittot@linaro.org, amit.kachhap@gmail.com, linux-kernel@vger.kernel.org, javi.merino@kernel.org, rui.zhang@intel.com, daniel.thompson@linaro.org, linux-pm@vger.kernel.org, Viresh Kumar References: <1519226968-19821-1-git-send-email-daniel.lezcano@linaro.org> <1519226968-19821-7-git-send-email-daniel.lezcano@linaro.org> <20180327020331.GA21693@leoy-ThinkPad-X240s> <8ee2cb0d-9afe-6626-0911-90ff6660bf8a@linaro.org> <20180327122836.GD10639@localhost.localdomain> From: Daniel Lezcano Message-ID: <719e1d94-170c-f208-d4a2-f3e882b1e20e@linaro.org> Date: Tue, 27 Mar 2018 14:31:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180327122836.GD10639@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/03/2018 14:28, Juri Lelli wrote: > Hi Daniel, > > On 27/03/18 12:26, Daniel Lezcano wrote: >> On 27/03/2018 04:03, Leo Yan wrote: >>> Hi Daniel, >>> >>> On Wed, Feb 21, 2018 at 04:29:27PM +0100, Daniel Lezcano wrote: >>>> The cpu idle cooling driver performs synchronized idle injection across all >>>> cpus belonging to the same cluster and offers a new method to cool down a SoC. >>>> >>>> Each cluster has its own idle cooling device, each core has its own idle >>>> injection thread, each idle injection thread uses play_idle to enter idle. In >>>> order to reach the deepest idle state, each cooling device has the idle >>>> injection threads synchronized together. >>>> >>>> It has some similarity with the intel power clamp driver but it is actually >>>> designed to work on the ARM architecture via the DT with a mathematical proof >>>> with the power model which comes with the Documentation. >>>> >>>> The idle injection cycle is fixed while the running cycle is variable. That >>>> allows to have control on the device reactivity for the user experience. At >>>> the mitigation point the idle threads are unparked, they play idle the >>>> specified amount of time and they schedule themselves. The last thread sets >>>> the next idle injection deadline and when the timer expires it wakes up all >>>> the threads which in turn play idle again. Meanwhile the running cycle is >>>> changed by set_cur_state. When the mitigation ends, the threads are parked. >>>> The algorithm is self adaptive, so there is no need to handle hotplugging. >>> >>> The idle injection threads are RT threads (FIFO) and I saw in >>> play_idle() set/clear flag PF_IDLE for it. Will these idle injection >>> threads utilization be accounted into RT utilization? >>> >>> If idle injection threads utilization is accounted as RT tasks >>> utilization, will this impact CPUFreq governor 'schedutil' for OPP >>> selection? >> >> Hi Leo, >> >> The idle injection task has a very low utilization when it is not in the >> play_idle function, basically it wakes up, sets a timer and play_idle(). >> >> Regarding the use case, the idle injection is the base brick for an >> combo cooling device with cpufreq + cpuidle. When the idle injection is >> used alone, it is because there is no cpufreq driver for the platform. >> If there is a cpufreq driver, then we should endup with the cpu cooling >> device where we have control of the OPP (and there is no idle injection >> threads) or the combo cooling device. >> >> Except I'm missing something, the idle injection threads won't impact >> the OPP selection. > > Mmm, they actually might. schedutil selects max OPP as soon as it sees > an RT thread. I fear these guys might generate unwanted spikes. Maybe > you can filter them out? Yes, absolutely. Leo pointed it also. We might want to change the check at: https://elixir.bootlin.com/linux/v4.16-rc7/source/kernel/sched/cpufreq_schedutil.c#L364 in order to ignore PF_IDLE tagged tasks. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog