Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4209511ybx; Mon, 4 Nov 2019 09:30:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzI2lrs7rfC5HEDGtYuHNXboJtpX21A88x9+6uNfU0REYBpbY6/rSch4xx9oBhKCFr4Lblv X-Received: by 2002:a17:906:1e02:: with SMTP id g2mr25030418ejj.6.1572888633714; Mon, 04 Nov 2019 09:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572888633; cv=none; d=google.com; s=arc-20160816; b=jA27iw50vglhYbZnf++yg04sJBu4jwFAGlszptOV0eZjC9CUpsaMqoVj/KPP7TP4sm TH+f8T+Dtu6jvyUj4KFZpibW7DV/iYg/fKArx21URza2fMyVqbNPt8csTLOFeSTqcLOd loGQZaiih7ZRAtdiuLrbN0tfCe4EgzP2hKAh9WTvP1VG9m6K2jmyG+jbKMjNx8wPSFOG Jf9OF28qlfPkcLhAECxQgb7IhsCFPj4u+Nh+Z7h8fhRoyfQDPBoprwi1StpdPFS+NUm8 cTsmQrcp0wQpk8hfa1ctxjdNpSnb8lbdaD5P/wwgyHDw/D41CM55bkJ3eS846IOEngKf Vojw== 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; bh=5BOOm1+BsWbeTh3lk2ySOoXmS0mlTF1m4FBkQUWGbNQ=; b=bjX10TWWM/6pniPFOLZNGW8rKBiMN246PufqI1n17kBK7EMsusamgDKHs8RzUYWu29 6wguzCyJsZiuHY7wBK12pSFK33I/pv0y819YThfrUXiaT3uc1VNvOISJFb0oIKMoJlrz kcPYK7lklEDxqUwe/AsHrIN1Vp5JmCogbiA13Y00lQJSnzNpowe8QgICYV/lyfjCWpPS 1WM+2ux//VeAf/BliZUhqcukKLu1eTM/ms6i7sZs/tBjwbN3V4CpueZ/K7cQr5n/JU+b HMlE6i1egIJb7kJ0gl2GJfIjEY2EUeU6Uhf3M+Wk79Fs0V092UefDn3HrnLx95a5Y1+O bhdg== ARC-Authentication-Results: i=1; mx.google.com; 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 pw7si11878688ejb.157.2019.11.04.09.30.09; Mon, 04 Nov 2019 09:30:33 -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; 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 S1728971AbfKDR3a (ORCPT + 99 others); Mon, 4 Nov 2019 12:29:30 -0500 Received: from foss.arm.com ([217.140.110.172]:47984 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728321AbfKDR33 (ORCPT ); Mon, 4 Nov 2019 12:29:29 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3D9E91F1; Mon, 4 Nov 2019 09:29:29 -0800 (PST) Received: from [192.168.0.9] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 68C9A3F71A; Mon, 4 Nov 2019 09:29:27 -0800 (PST) Subject: Re: [Patch v4 2/6] sched: Add infrastructure to store and update instantaneous thermal pressure To: Thara Gopinath , mingo@redhat.com, peterz@infradead.org, ionela.voinescu@arm.com, vincent.guittot@linaro.org, rui.zhang@intel.com, edubezval@gmail.com, qperret@google.com Cc: linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, daniel.lezcano@linaro.org References: <1571776465-29763-1-git-send-email-thara.gopinath@linaro.org> <1571776465-29763-3-git-send-email-thara.gopinath@linaro.org> <379d23e5-79a5-9d90-0fb6-125d9be85e99@arm.com> <5DBC9C57.3040504@linaro.org> From: Dietmar Eggemann Message-ID: Date: Mon, 4 Nov 2019 18:29:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <5DBC9C57.3040504@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/11/2019 21:57, Thara Gopinath wrote: > On 11/01/2019 08:17 AM, Dietmar Eggemann wrote: >> On 22.10.19 22:34, Thara Gopinath wrote: >> >> [...] >> >>> +/** >>> + * trigger_thermal_pressure_average: Trigger the thermal pressure accumulate >>> + * and average algorithm >>> + */ >>> +void trigger_thermal_pressure_average(struct rq *rq) >>> +{ >>> + update_thermal_load_avg(rq_clock_task(rq), rq, >>> + per_cpu(delta_capacity, cpu_of(rq))); >>> +} >> >> Why not call update_thermal_load_avg() directly in fair.c? We do this for all >> the other update_foo_load_avg() functions (foo eq. irq, rt_rq, dl_rq ...) > thermal.c is going away in next version and I am moving everything to > fair.c. So this is taken care of > >> >> You don't have to pass 'u64 now', so you can hide it plus the > > You still need now.All the update_*_avg apis take now as a parameter. You do need it for the ___update_load_sum() call inside the foo_load_avg() functions. But that doesn't mean you have to pass it into foo_load_avg(). Look at update_irq_load_avg() for example. We don't pass rq->clock as now in there. -int update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity) +extern int sched_thermal_decay_coeff; + +int update_thermal_load_avg(struct rq *rq, u64 capacity) { + u64 now = rq_clock_task(rq) >> sched_thermal_decay_coeff; + if (___update_load_sum(now, &rq->avg_thermal, capacity, capacity,