Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1843788ybv; Fri, 14 Feb 2020 07:01:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxAR1WHscW7i0+QxyQNdKGSb9jf6ES+XnmJaLEAugUVKnO0Y+22B4PeUz5apf02cC2A2mpS X-Received: by 2002:a9d:7842:: with SMTP id c2mr2438778otm.252.1581692486006; Fri, 14 Feb 2020 07:01:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581692486; cv=none; d=google.com; s=arc-20160816; b=wjbEYnpDlulQiRFufjLPUlZ8zEUFUNRrnBwRsbsl1tERewnVsS/T3lDtlduq30m3HM bG0cB61eKjObJa5XlcAvlXy6kBsMtzk1q1Xyv+qb+fzBLOxzZ+s/hnBhYjgxqthRDpDE 3/Oa99UDW+pK7Dl2naN5BKMOSem+PFhxKYU/X3q0DW8vq/kukutz0mHCiBgu14xDSAGZ 03J+uR4oheTwjak1kscLAAP8Tg2M8rlKUAbdh5dsRJ525MF/Glkg0PDC/lWOJ2rSmCMj 34vI5mf2r9QBYS3ad76iFvLJPQXiyn2iEWzhhlDBOVxJCJnWzy8LoFftCvfbBC/K3SPa kndA== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=PZM2aXQLz6EGVmRob1//c/oSoiPKekrSfa4uLtVv4nQ=; b=mdUMKylZasRw0v254hGgJbRZ0jQTIhgcXyZp7nmiQ4vLywOKvC7sqay9ZNPjBAkrfx IMlqyx1PJLKSAXQE6pWzTlApya3kl7+eXsReHvxI96fDJgpkR5jAUlzW6NUqNw8/s9vy jAXtcb7fdRn363y36hdf8xUc65nOBHNVaEslJaOf2uvmNf8uaLpf4etmr3eNG85eX6uW gkwUy9uGxiuWzQMymqAOEKo9YXkno4Ud36hWu8iTACh7AmMwPgevzGXnFhkohIrkUf2A InoBW1yzu8da4COJZHr7sK0RxPkrn9JtUABUC4YlCUESmv6LYR1AdlyArmyiAlxs3IkW LBDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rkxaeZPM; 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 m26si3025671otk.305.2020.02.14.07.01.13; Fri, 14 Feb 2020 07:01:25 -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=rkxaeZPM; 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 S1729479AbgBNPBJ (ORCPT + 99 others); Fri, 14 Feb 2020 10:01:09 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:44651 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729268AbgBNPBI (ORCPT ); Fri, 14 Feb 2020 10:01:08 -0500 Received: by mail-qk1-f196.google.com with SMTP id v195so9420043qkb.11 for ; Fri, 14 Feb 2020 07:01:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=PZM2aXQLz6EGVmRob1//c/oSoiPKekrSfa4uLtVv4nQ=; b=rkxaeZPMCtLStsYRndTgSrzO9UsxBW9lI3HGrZM5t8dv8MUzFk8tTMiwDRecR6vlna M0dFl8n80k6Q+TTHqnUCklACuoCYTemyZGG+/qhjbP3NBMpr8qhjaeu+1KCNtB8yZOkj gS/H8Mfqm43tAd5J+PFMigStoFTrx5j3g6EHv38rk/iBL90FAzC6VJzWbN4lUddOqPQ5 oMNUSJZIHmNhXF2q5LLEcev+MRuGoBdz0t1yYjHkYlZPAWyB4FrwwV0yQtrOGqE3U/ID psAumSjUzo6pUxluoQTl7PeGpeFyxmGwmf0alzjPFqQRRwaH6QGPVfiVMQuXyDXUC8OW xlIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=PZM2aXQLz6EGVmRob1//c/oSoiPKekrSfa4uLtVv4nQ=; b=F6I96Ax5dyg4/m4B1trXu/o+SMPLQuSsvZKy+LOrxKoDqh7+QDAqxNUfbZDgpRzwx/ 62rioXY6j/FdLDorz6e/0lIH8q9zoyDxLmVSPrR2X3eivy3UICSjOR4yJ8p76CskC8Fh 9Zq7AYkU1C89m3b8caAgorj8uKSp/nuqUijIvq+k3k3XS/8MkMiPkzuMc0xTnMSTpZNe vvL1UTJY1YVKisAxzA/Uu1igW/RIysP0UWYFPfhhvOvZ+y2V711rDe5g84QpE4irvp0k /cIiKmPJhDWJw+sL+yitjAFu1I0umUwaEgoYFIrSdTZSa1cifhi34h106GmjL/fb3r43 WOAg== X-Gm-Message-State: APjAAAVG2SwzHwDSl1V/joX8oggSdXtYWODgKT3qJTo6pk8az+PW8YAf se8mJthtmUlCXuCYbc3skxIHQw== X-Received: by 2002:a37:9d44:: with SMTP id g65mr2716368qke.15.1581692467642; Fri, 14 Feb 2020 07:01:07 -0800 (PST) Received: from [192.168.1.169] (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.gmail.com with ESMTPSA id h14sm3355056qke.99.2020.02.14.07.01.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Feb 2020 07:01:06 -0800 (PST) Subject: Re: [Patch v9 3/8] arm,arm64,drivers:Add infrastructure to store and update instantaneous thermal pressure To: Amit Kucheria References: <1580250967-4386-1-git-send-email-thara.gopinath@linaro.org> <1580250967-4386-4-git-send-email-thara.gopinath@linaro.org> <5E4557B1.8020809@linaro.org> Cc: Ingo Molnar , Peter Zijlstra , ionela.voinescu@arm.com, Vincent Guittot , Dietmar Eggemann , Zhang Rui , qperret@google.com, Daniel Lezcano , Viresh Kumar , Steven Rostedt , Will Deacon , Catalin Marinas , Sudeep Holla , Juri Lelli , corbet@lwn.net, LKML , Amit Daniel Kachhap , Javi Merino From: Thara Gopinath Message-ID: <5E46B631.5020406@linaro.org> Date: Fri, 14 Feb 2020 10:01:05 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/13/2020 09:38 AM, Amit Kucheria wrote: > On Thu, Feb 13, 2020 at 7:35 PM Thara Gopinath > wrote: >> >> On 02/13/2020 07:25 AM, Amit Kucheria wrote: >>> On Wed, Jan 29, 2020 at 4:06 AM Thara Gopinath >>> wrote: >>>> >>>> Add architecture specific APIs to update and track thermal pressure on a >>>> per cpu basis. A per cpu variable thermal_pressure is introduced to keep >>>> track of instantaneous per cpu thermal pressure. Thermal pressure is the >>>> delta between maximum capacity and capped capacity due to a thermal event. >>> >>> s/capped/decreased to have consistent use throughout the series e.g. in patch 1. >>> >>> Though personally, I like "capped capacity" in which case >>> s/decreased/capped in patch 1 and elsewhere. >> >> I will fix this >>> >>>> >>>> topology_get_thermal_pressure can be hooked into the scheduler specified >>>> arch_cpu_thermal_capacity to retrieve instantaneous thermal pressure of a >>>> cpu. >>>> >>>> arch_set_thermal_pressure can be used to update the thermal pressure. >>>> >>>> Considering topology_get_thermal_pressure reads thermal_pressure and >>>> arch_set_thermal_pressure writes into thermal_pressure, one can argue for >>>> some sort of locking mechanism to avoid a stale value. But considering >>>> topology_get_thermal_pressure can be called from a system critical path >>>> like scheduler tick function, a locking mechanism is not ideal. This means >>>> that it is possible the thermal_pressure value used to calculate average >>>> thermal pressure for a cpu can be stale for upto 1 tick period. >>>> >>>> Signed-off-by: Thara Gopinath >>>> --- >>>> >>>> v6->v7: >>>> - Changed the input argument in arch_set_thermal_pressure from >>>> capped capacity to delta capacity(thermal pressure) as per >>>> Ionela's review comments. >>>> >>>> arch/arm/include/asm/topology.h | 3 +++ >>>> arch/arm64/include/asm/topology.h | 3 +++ >>> >>> Any particular reason to enable this for arm/arm64 in this patch >>> itself? I'd have enabled them in two separate patches after this one. >> >> No reason. No reason not to as well as arch_topology is "Arm specific >> cpu topology file" and changes are one-liners. > > One reason to do this, IMHO, is to keep platform conversions separate > from the core infrastructure in a series, so the core can get merged > while platform maintainers can take their time to decide if, when, how > to merge this. That makes sense. I will split it out. I did not think of it from a merging point of view. > -- Warm Regards Thara