Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3144155imm; Mon, 10 Sep 2018 11:47:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbhBn+2gHHfnan8dqAauunMTA8vHUb6f1Y7sn7Xq5vISLopOD+OvIo46n+wAVw59Vz/kFpZ X-Received: by 2002:a62:c699:: with SMTP id x25-v6mr25488388pfk.16.1536605246974; Mon, 10 Sep 2018 11:47:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536605246; cv=none; d=google.com; s=arc-20160816; b=fRfRjmFloKLTN4hIEBbdB4VHEPIAO9wN8B0U92kdxnkkkY3wmux2W0jS9x2nOk8Xf1 0Bg6akah1T6DcAAzSyan5EooT/xXXoSQZnm0xnNe8msNCwQF6MmhDBALuKJLQW4GR+8m tY13BHAghqD35spl2siXBaCa77bTfZvwct/bfay0kWEK94y9KHavMYt8dAJJ0G2xMl5t S9fCI09LRzu2r7lHPUgrGKvGXC8GSFAE+pBFWwzf+/WDyYF/fQJpbixc7k5vwyOQ7loF zyOFBc6OQTGLkjYwuMuQNnk9X1Z9KMbuobQ6jNoDbIhMxYH3Qguvs5jr0ho+ELPUGsdn ObcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=1pD0XKW0r+nvEF19qPjK6fNThtxK4+55x9gW01AWhVM=; b=x+IF6b22PCThhW+ydSPm+Y5BK30AgxxFazxSSteXFao65qdI1qZhXYpmv/1c4mObyA C6e5HtdGNwFYgT1+XxIJseKX9gtBVJbpggg42UYTqpkiiy2F+gMVMJ+qTVNmYUSsliMN UQ+Q7FJ0hafgyHXuNw2t2BaMsjTZPImpC9J4nU043DuhhQx0smFxH0Yzodc61pG56/Zy GORAVPLKklCfeRTVc6rufI8cM8qIrZZqc6KD7+mCZWApvCWz07nxUWuJytWEgF50Tpw3 B3UL7WnNBPFuVHp7Tnahnabcyopbkhd0hfsCGoV4ajXygXwJhta6CbLn1XQfLsF6xkBr NdAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PW+EU1+a; dkim=pass header.i=@codeaurora.org header.s=default header.b=M6+3kQPb; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16-v6si16775420plr.343.2018.09.10.11.47.11; Mon, 10 Sep 2018 11:47:26 -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=@codeaurora.org header.s=default header.b=PW+EU1+a; dkim=pass header.i=@codeaurora.org header.s=default header.b=M6+3kQPb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728767AbeIJXk4 (ORCPT + 99 others); Mon, 10 Sep 2018 19:40:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56870 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726755AbeIJXk4 (ORCPT ); Mon, 10 Sep 2018 19:40:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 421C760818; Mon, 10 Sep 2018 18:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536605129; bh=gWrauniN2bnZujZu1yJlx5qroc02dR/bETchJHU98JI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PW+EU1+ahNK+TKAGP5PXye7rEQ32tjL6sFe5976a1PYLNWZuW9gu7pfmNaOQBuCgN qAUarmW3eB1lfkkURHMvoR9TUrr8Ykj9WHip6oLLXZ4KQq+fc2zOZmvw3x1KXraW8a qrzIBSVn4vb2eJs3wtfdp4ENxD+5GYr4qeAmlE+Q= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id BEDA1607EB; Mon, 10 Sep 2018 18:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536605128; bh=gWrauniN2bnZujZu1yJlx5qroc02dR/bETchJHU98JI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=M6+3kQPbL+KGWlDQSDOr13bDWU4rdEUqu/S4ysVyJLv4tzPF+MuCzAyBTv7ME75Kt SJUyjclWvSM8/+53gy/BCGiz/OoeSS1Lk2nnE2liXN2lxh2Ivj4pM0OhdWzmFhi+zb PGJty+c+KX57r7C7e1L24n0pftAcOoyn5TDOQUMM= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 11 Sep 2018 00:15:28 +0530 From: Sibi Sankar To: skannan@codeaurora.org Cc: myungjoo.ham@samsung.com, Kyungmin Park , Chanwoo Choi , Rob Herring , Mark Rutland , georgi.djakov@linaro.org, vincent.guittot@linaro.org, daidavid1@codeaurora.org, bjorn.andersson@linaro.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-owner@vger.kernel.org, viresh.kumar@linaro.org Subject: Re: [PATCH v3 1/2] PM / devfreq: Generic CPU frequency to device frequency mapping governor In-Reply-To: <35ff3e303f5de9980979b49c89f9a687@codeaurora.org> References: <1533171465-25508-1-git-send-email-skannan@codeaurora.org> <20180802095608epcms1p33fb061543efc9ceb3ec12d5567ceffbc@epcms1p3> <45c77ee02536e237c054399cad4c7669@codeaurora.org> <35ff3e303f5de9980979b49c89f9a687@codeaurora.org> Message-ID: <37035cf602bb0f5491240a021af46608@codeaurora.org> X-Sender: sibis@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Saravana, On 2018-08-07 11:19, skannan@codeaurora.org wrote: > On 2018-08-02 14:00, skannan@codeaurora.org wrote: >> On 2018-08-02 02:56, MyungJoo Ham wrote: >>>> Many CPU architectures have caches that can scale independent of the >>>> CPUs. >>>> Frequency scaling of the caches is necessary to make sure the cache >>>> is not >>>> a performance bottleneck that leads to poor performance and power. >>>> The same >>>> idea applies for RAM/DDR. >>>> >>>> To achieve this, this patch adds a generic devfreq governor that >>>> takes the >>>> current frequency of each CPU frequency domain and then adjusts the >>>> frequency of the cache (or any devfreq device) based on the >>>> frequency of >>>> the CPUs. It listens to CPU frequency transition notifiers to keep >>>> itself >>>> up to date on the current CPU frequency. >>>> With the cpu-freq driver for SDM845 SoC supporting fast_switch and schedutil supporting dynamic switching wouldn't this governor be incompatible due to its reliance on transition notifiers? Is it planned to be used only with ondemand/performance governors? >>>> To decide the frequency of the device, the governor does one of the >>>> following: >>> >>> This exactly has the same purpose with "passive" governor except for >>> the >>> single part: passive governor depends on another devfreq driver, not >>> cpufreq driver. >>> >>> If both governors have many features in common, can you merge them >>> into one? >>> Passive governor also has "get_target_freq", which allows driver >>> authors >>> to define the mapping. >> >> Thanks for the review and pointing me to the passive governor. I agree >> that at a high level they are both doing the same. I can certainly >> stuff this CPU freq to dev freq mapping into passive governor, but I >> think it'll just make one huge set of code that's harder to understand >> and maintain because it trying to do different things under the hood. >> >> There are also a bunch of complexities and optimizations that come >> with the cpufreq-map governor that don't fit with the passive >> governor. >> >> 1. It's not one CPU who's frequency we have to listen to. There are >> multiple CPUs/policies we have to aggregate across. >> 2. We have to deal with big vs little having different needs/mappings. >> 3. Since it's always just CPUfreq, I can optimize the handling in the >> transition notifiers. If I have 4 different devices that are scaled >> based on CPU freq, I still use only 1 transition notifier. It becomes >> a bit harder to do with the passive governor. >> 4. It requires that the device explicitly support the passive governor >> and pick a mapping function. With cpufreq-map governor, the device >> drivers don't need to make any changes. Whoever is making a >> device/board can choose what devices to scale up base on CPU freq >> based on their board and their needs. Even an end user can say, scale >> the GPU based on my CPU based on interpolation if they choose to. >> 5. If a device has some other use for the private data, it can't work >> with passive governor, but can work with cpufreq-map governor. >> 6. I also want to improve cpufreq-map governor to handle hotplug >> correctly in later patches (needs more discussion) and that'll add >> more complexity. >> >> I think for these reasons we shouldn't combine these two governors. >> Let me know what you think. > > Friendly reminder. > > Thanks, > Saravana -- -- Sibi Sankar -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.