Received: by 10.223.176.46 with SMTP id f43csp690255wra; Fri, 26 Jan 2018 05:27:19 -0800 (PST) X-Google-Smtp-Source: AH8x225WgZcZfC0LWMSLIHSIZLfFvwRz2XX3NFnc08IZ9UDgoAxzwH4uUwhUMGM2yaZXxXJYr5FU X-Received: by 10.101.82.68 with SMTP id q4mr15351172pgp.369.1516973239358; Fri, 26 Jan 2018 05:27:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516973239; cv=none; d=google.com; s=arc-20160816; b=x685cFXtLMWHCO4A5fOe/bP9ld5TF1MKln/QfVkMZ67Uex/6UiwctdHX/jAhcrSEWN p/JOJ0JOxnW2wM+Fgoe2OG/G7DdbjShSUuKS8Jsscr30wu5rwFroO692XfeoSyOiEnJ2 laFPOCTBgUncXVQeSQmYxz3vIhL8LBZVLuQRBY0jfpiw2sYaaC+ssNtdu04zODRfut8Z WW2Wf6KgDRfJtUZvKUNPES2v0+2gUtqggkiQPeCkqxT3P5SafC0fAXDyzNIII/LbMpVV IU8F8mLnDtcGnlONls1Evf/eduh9Zkce+AmXN/cl6x+ZpiYMEf1nlLotw469o69MwKEi ihtg== 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=AVWPI8mmgYB131PzXE682Tzh/vxjrMrOysmbVUO/3Vg=; b=E1DzUsCzXKTD692HmELQsnz8iVJ2PO/C9k9okASH5XQ28pSyETnZocsZlCOow1o1Ad gmWPbdNl2b1GKWXDyR4YK9bqnGxAoOj0Lq6zyuudpRsAgbqKdKJwSETCO7xIHMWIQJHd NU941xMIIhBH8VVAcXEsKsMPY4vivGEvTxyior0cXqpSuoAxg6GDJYkloouf7seFgGFm pT9AVrN3xAyaiSNpAsWwOr/NyvpBWwCJ/6N3hvBlBd4o9lQpTBEXGgy+RIayz2LJh/MC V5e0/6CaydtOkxTceJwK8yWbQVm0GRTZtQCfXGz1H+cWuiYqTcJlkFW/DejnJofLTIE6 ynfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G4dPUxsr; 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 e6si3017859pgf.240.2018.01.26.05.27.04; Fri, 26 Jan 2018 05:27:19 -0800 (PST) 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=G4dPUxsr; 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 S1752314AbeAZN0F (ORCPT + 99 others); Fri, 26 Jan 2018 08:26:05 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:54316 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752427AbeAZN0C (ORCPT ); Fri, 26 Jan 2018 08:26:02 -0500 Received: by mail-wm0-f68.google.com with SMTP id i186so1259335wmi.4 for ; Fri, 26 Jan 2018 05:26:02 -0800 (PST) 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=AVWPI8mmgYB131PzXE682Tzh/vxjrMrOysmbVUO/3Vg=; b=G4dPUxsr+cqtUJeDMkHGmIgXDYzN83Ok6wgOqjVpThm2eSWwcZ2C+jxKOS/V8nINYQ /9fdCY7Qyy1lEUiIVflXO1jCwRalYfX669QqDYE1SqmkEU2FxIOBPLXMaMrPPK5dlCxr n+QIvIG1NDEfaQ+pOHb0tG0kAqI6OpUPeSWnE= 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=AVWPI8mmgYB131PzXE682Tzh/vxjrMrOysmbVUO/3Vg=; b=tuOoDP9oSAhxChRL8vZdNuS4uguCE3yP3WJG9azj2fgPFS5z90OKNPiOij7jv8Djq7 zbjLVJrDRj2xUtZg7r8/Zf6/ZRWrjYvXJsxZp0+PUytB11sKNPCe8Y/vYaclXeXL5VFx uf1xTzJ/qkkeO7n9DiEuPrQA1Hz65xHd55GhnlnBwRtW9Wj2YQx7an3uqEBsBNauwGy1 XqJNXDjLtNA5OumX0lyHOK01JLHhCEDBKJpHyUdtSwZ+Kr5eXC2SqSJwSu3m02pnrXEi wsVqOdayaIgiGVOWs0z9Enh36S+z2OlGoniDu8MbHH/2uUOC9C3XSkenYVBTQEdLj2ei mZBg== X-Gm-Message-State: AKwxytesEnCJ4yHRpiBgkop+Ud1ssKlmUPE73ActwBzhKL/WE1y6BxtB 1ZcatYogNU+DRJShYj3kfdspWg== X-Received: by 10.80.167.65 with SMTP id h59mr7851978edc.78.1516973161126; Fri, 26 Jan 2018 05:26:01 -0800 (PST) Received: from ?IPv6:2a01:e35:879a:6cd0:3e97:eff:fe5b:1402? ([2a01:e35:879a:6cd0:3e97:eff:fe5b:1402]) by smtp.googlemail.com with ESMTPSA id 6sm580335edl.87.2018.01.26.05.25.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 05:26:00 -0800 (PST) Subject: Re: [PATCH 4/8] thermal/drivers/Kconfig: Convert the CPU cooling device to a choice To: Daniel Thompson Cc: edubezval@gmail.com, kevin.wangtao@linaro.org, leo.yan@linaro.org, vincent.guittot@linaro.org, amit.kachhap@gmail.com, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, Zhang Rui , "open list:THERMAL" References: <1516721671-16360-1-git-send-email-daniel.lezcano@linaro.org> <1516721671-16360-5-git-send-email-daniel.lezcano@linaro.org> <20180124163441.7sqq7qny66d6sqrz@oak.lan> <02e80d2c-3672-f7e2-dfb2-aed3efc84759@linaro.org> <20180125105715.sae3nwvz7u32v4va@oak.lan> <20180126121609.qfahclcdamii7a27@oak.lan> From: Daniel Lezcano Message-ID: <301b5fe7-472e-6291-2880-4202de657de8@linaro.org> Date: Fri, 26 Jan 2018 14:25:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180126121609.qfahclcdamii7a27@oak.lan> 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 26/01/2018 13:16, Daniel Thompson wrote: > On Thu, Jan 25, 2018 at 02:36:12PM +0100, Daniel Lezcano wrote: >> On 25/01/2018 11:57, Daniel Thompson wrote: >>> On Wed, Jan 24, 2018 at 05:59:09PM +0100, Daniel Lezcano wrote: >>>> On 24/01/2018 17:34, Daniel Thompson wrote: >>>> However, we are talking about distros here but the CPU cooling mechanism >>>> is for mobile and in this case the kernel (usually Android based) comes >>>> with a specific configuration file and this is where the SoC vendor has >>>> to choose the right strategy. >>> >>> I agree its hard to conceive of a modern Android device that doesn't implement >>> both the needed features but the performance figures in the covering >>> letter come from Hikey (and they look pretty good) and Hikey is >>> supported by a good number of regular Linux distros now. >>> >>> Using Kconfig to force what should be runtime decisions to happen at >>> compile time means that Hikey becomes an example of a platform that >>> is unable to run at max performance on the distros that have added >>> support for it. >> >> I disagree. The ARM64's defconfig is not distro ready. We have always to >> change the default option and fix things in the Kconfig to make the >> hikey to work (eg. the missing hi655x clock config), without speaking >> about the hikey960 which is not yet ready for full support. >> >> Hence, tweaking the Kconfig to choose the better strategy is not >> necessarily a problem for this first iteration of code. > > The problem is not about tweaking config for a distro. No distro I know > defconfig kernels. Tweaking is normal and expected. > > The problem is that a distro cannot generate a config that performs > optimally on all devices that it supports because enabling one form of > CPU cooling prevents other forms from being selected. There is no > correct value for us to select if we don't know in advance what board > the kernel image will be loaded on. > > Given the massive work that has gone on (especially in ARM ecosystem) > to allow one kernel binary to support many boards at once it surprises > me to see new features proposed that cannot be exploited without > recompiling the kernel from platform to platform. > > >> Note I'm not against changing the code to make it runtime selectable but >> that will need a major rework of the current CPU cooling code especially >> handling the change while the thermal framework is doing the mitigation >> (and probably also changes of the thermal framework). > > Perhaps I should have distinguished more between runtime-meaning-boot-time > and runtime-meaning-full-system-operation. To be clear none of my > comments are about being able to enable/disable idle injection on a > fully running system. It is the impact on multi-platform binaries that > attracted my attention. > > >> I prefer to keep simple self-encapsulated feature code and make it >> evolve to something better instead of sending a blowing patch series >> taking into account all possible combinations. Choosing the strategy at >> compile time may be look restrictive but we can live with that without >> problem and iteratively do the change until the choice becomes the >> default strategy selection option. > > You won't find me arguing against iterative improvement. However I > did observe that the idle injection code consists almost exclusively > of new lines of code. Thus I don't understand why this new code > interferes with cpufreq cooling to the point that the existing cooling > options must compiled out of the kernel before we can exploit it. > > I can see the combo code does have tentacles in more places but even so > I have the same question. What prevents the existing cooling strategy > from being compiled at the same time. > > You appear to be saying that there's not yet enough infrastructure to > decide which type of cooler to instantiate[1] so its OK to hack around > the decision by forcing it to be made it at compile time. Even if we > want to force a decision by some means, is compile time really the best > point to do that? For the moment, yes. We are backward compatible, there is no change with the current feature. I don't see really the point of being so afraid with this compilation option, it is not the first time we have compile time code which migrates to runtime code. The important thing is we don't break the existing. Having the runtime selection is the objective after improving the CPU cooling devices. But this is far from being trivial and will need a rework of the cooling device / framework (and the changes grouped in a separate patch series). > [1] Is that because the DT isn't rich enough for us to figure out > the trade off between using real OPPs and virtual idle-injected > ones nor whether cpuidle entry/exit is fast enough for cooling > to be effective? Yes, it is one aspect. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog