Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4216552ybx; Mon, 4 Nov 2019 09:36:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzbaOpa9Q4F0yGXBeNyKBvxvo/MvXR5OOnAsOW9UoiO+9pzToMeVfhF5xB1iYM2lorPb71K X-Received: by 2002:a17:906:95c2:: with SMTP id n2mr25093870ejy.21.1572889001415; Mon, 04 Nov 2019 09:36:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572889001; cv=none; d=google.com; s=arc-20160816; b=ZlkDV/7wFFHmJJpmj5moFFLqHvYTTWG5xpJ2IZPnjQSYhXgHrD7P5z0mY6mhu911P3 LVqEnf6JVhJOVwBbKCljzLcED5kthAIeum+b80Zz4S7jCsaPkyjyQnqGVPwTLZSatn01 Sn0zo4wJOz1aXygcr1a+YPhvbGqxVu3fc/gJVMRnVeVVcM2IHv9POW+TbD4MnZgDlI6R SisbKt79jvllWxC5ZiBT7iasDufhs8M+DhMoH4kYCJ2m6VLCPHY6A40NdWoz40z0Nzzc eyb0WmTYwMuRBS6V1akxnz6EePbykG+tU7OxkAAJsY7xwfvtp6+z78w7CT/h8hMAWav5 K8xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MWcQLucKakVRcVWjMHhLsE/d2P0WRzHGP12bGvdrWzk=; b=QgNxRm8qmlz6gpw+6osnNLXxyqOIEmWeIC/uYQT0DlXSbhe9blJAFuHzFL8x3Ddf6Q z87Y65+rZbTPBbqujaOieumAyAKbOssyY7h0YuTVBoCzH9xLaIvpGFV9IqjcyxA+wmjD CErJ9yPeBQLf5vib+whTz8X518+sAydTvKr6GcsrzVsKMGMMub4q0m/3r0l3gl7N7jVd pfL5mG34OPcrbdTUMUBBX4tZmAxZeZ5AC35puZkPuJTjojDDEX2E/bw78YkDfgSxgLPg OHx5v743j02j0uucRcAm9cmAtRTkPwI37gEgF8moavr/vlgxmeqJIcc8Iu7XPU1zJQd2 tQBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H8BFTOIL; 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 um11si11469635ejb.263.2019.11.04.09.36.17; Mon, 04 Nov 2019 09:36:41 -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=H8BFTOIL; 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 S1729412AbfKDReo (ORCPT + 99 others); Mon, 4 Nov 2019 12:34:44 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:46249 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728188AbfKDReo (ORCPT ); Mon, 4 Nov 2019 12:34:44 -0500 Received: by mail-lj1-f195.google.com with SMTP id e9so5276532ljp.13 for ; Mon, 04 Nov 2019 09:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MWcQLucKakVRcVWjMHhLsE/d2P0WRzHGP12bGvdrWzk=; b=H8BFTOILGKhU7JUZq40IbMXCMx96p38TVrJa3csSxbWEJEfMj8lUOqG7acNKWOmRlt fpUiGtjy6HkSjpVT7qUvOlVcrXLsOYkT87iTUyz0PzFN6kHeJ/TxFUcqdw6vlMmvf6Y9 dTQpoKzpJVYqhIETrBqi+1cRYeti+/Ddnniy6XbIiVNT19INjmlU20nMk7BRAirrxhdQ DCEHMOz1QFtKlrxmQnAvXPSI/C8e+7rpSwiRgr6UjYYOA+b2+aYjsQMJqvhSHj0jzzFj nJYJCvaraI5JnpAnGSgflrf2COmGwMenTz9wACgdbQ1VoqQItr8hhgpvSDrNWyQUrFXj ybzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MWcQLucKakVRcVWjMHhLsE/d2P0WRzHGP12bGvdrWzk=; b=ZC3R5IoE6eSu62tN+su/cfNeo74U2IqkDR4l3YqEMrFQZ8RWDgW/0J7zC3mwovF4z8 0MD026/R3463aDvjESe1wunziIQOG40Ir+F4fQTyzRkkB4f33kbyjihPgPMP0winlKpx jPlanplT7T/LtKzvT4ur/Ac9pKyvKSsxRxSiS/q4vSsHTNhEk+c/qSkC5HUhHE6+z8Kx 7TLgcp7bZeNX9CZIPAXT390+NQeXDydfLGYy1NMpcQ0inuCwS2OAo6ob4MKX/zR9cYtK laZQ8XZ8mlZbnHPEkJcLlfQLBkYafNpWSyNtzfM1S3f6/LfWJfoNTLO21RWb7fWviOt+ C2Og== X-Gm-Message-State: APjAAAUQ2SzpUR32RS1cJJ27LtVDMBnBc30hg2Xo0ND0GiGmkw0Nb2lg 6kFSDPgB3ZnATJ8kbOuGwtJd09rW19ufvOeS0no7ag== X-Received: by 2002:a2e:7811:: with SMTP id t17mr6036253ljc.225.1572888882759; Mon, 04 Nov 2019 09:34:42 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: From: Vincent Guittot Date: Mon, 4 Nov 2019 18:34:30 +0100 Message-ID: Subject: Re: [Patch v4 2/6] sched: Add infrastructure to store and update instantaneous thermal pressure To: Dietmar Eggemann Cc: Thara Gopinath , Ingo Molnar , Peter Zijlstra , Ionela Voinescu , Zhang Rui , Eduardo Valentin , Quentin Perret , linux-kernel , Amit Kachhap , Javi Merino , Daniel Lezcano Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 4 Nov 2019 at 18:29, Dietmar Eggemann wrote: > > 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. update_irq_load_avg is the exception but having now as a parameter is the default behavior that update_thermal_load_avg have to follow > > -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,