Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2045732ybl; Sat, 11 Jan 2020 08:00:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxyA21v5quPSCj9XtGeJ0034kek1KPzv4p5fOT9N+v4oCSTJpFbp/BGQwCGle9oWo1nZT/E X-Received: by 2002:a9d:21f5:: with SMTP id s108mr7638139otb.152.1578758423295; Sat, 11 Jan 2020 08:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578758423; cv=none; d=google.com; s=arc-20160816; b=h9pGg0frJ0XUy9QsMJJrCupV/qpqidYocWnC+xqLJwkZDcpoSKFRO3gEXV5ov7F+wz snLTqebcm0rtK7tAOebtexckC5UQ+MdjYrc8/1tcGre4zZuYwvBwFKXdQv6aSJGoGwim wZCrMGrXVifN8lj5Mo30T6gW1VYqeNzoB8c7kzprQcCk4E0lBLdG0UUVC5EEXICsOO76 WGQ3DUdQLbTuO/uBCKw72GqXrNYD4Oi4U/U7QIKyPSifU3hge9N4E1va82C+/xf53J7X Q8xowqFPsYZ7q8xVIQ7xRM4Ugpe/4w9svthHAdVQVjZMLrlkJRjq715cGcI+WzvhMByt HU+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=D0skf/6By7/rqfJ4BHcoMon/wG4Iy6pSq8JDg2nxI/M=; b=HtKBpkLAzHP0zk4bWLtqtOVDIG6Yaoehh2frRamHCnEsRUKlzAP1S5ZsHnAligsnZ3 JnVWu8pIfephxev8+7ePhUUA15bdpRdTLwAWheK4RBFI8K5lBN1D/XE5G3G31p89jBvA wrpfSqUp6oBpCHZgu6KhTcrjIPrUa8fto3LgJ4rbsVeKuSnUVQ3VSBEaATXlM8C0yX9w EajiH5amSXfXLwVeY1BwWe6swPrNZeXkx4u1578ROptTe1rHZhaNSeAoBu2NRJ96xD8z 4p4hPpr3tdPQiTaYeqbBk78U4lPtqoGkf+XiI+IEzo85RGApFwUQNoZvosiUdzUU7S7l 8Rbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rM+Ri7D0; 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 d9si995701otf.81.2020.01.11.08.00.11; Sat, 11 Jan 2020 08:00:23 -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=rM+Ri7D0; 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 S1730280AbgAKP7S (ORCPT + 99 others); Sat, 11 Jan 2020 10:59:18 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:37597 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730228AbgAKP7Q (ORCPT ); Sat, 11 Jan 2020 10:59:16 -0500 Received: by mail-qk1-f193.google.com with SMTP id 21so4810010qky.4 for ; Sat, 11 Jan 2020 07:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=D0skf/6By7/rqfJ4BHcoMon/wG4Iy6pSq8JDg2nxI/M=; b=rM+Ri7D05rcqzEAJiP6RRb/+gp17e21RBanp8BmDlGQ7ILWK9lApyI+aL8hVN/+reJ 8qylAxre5bWQqQRCfP30Zz7/psf5fA5KhKkiphgldNxHWjx42+bDQPpXBH43DMDaAciK 17GDTtAUN6DxdV6VboR8cw/c7HqZgjRZYlGU/PTt2Ps5rTS1b57D9SYVuTYWr6Kd57a6 av04RlTL2FFrnTpfkpsAToG1Ui36kH+UA1h10j95J3U0r1WAfXehvcXJkPuAbsfWjEhS k/vtT1B17SfsIyrMmKhwHB+k2Pj8zhr87SlvFPeNoddhBzfz/GlWdMaxSfFUqoYtpQzg ng+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D0skf/6By7/rqfJ4BHcoMon/wG4Iy6pSq8JDg2nxI/M=; b=GvPd+Bz2Z2EEbVBskCCdKqfrW/KGBJhBKsF09GCITgxvEAgy6snrGCVek3/XmLbS04 902YaLFQeDKn1NEGLSkJpikjf2VA3jye/aYSJe6uw3iE9krvau2Uzmb+HSeK1N3xInbv 3Zo8IYRtkAZx54L/Yed9Y8h5s0+d0Us5FSeJkBJ279g0CWiclcU+576XMKqjWsbK6iTl 1D9GxdPfZaSIZFC2Ul+HxYwnBM5v7cbzwRejNkagj+3RkhqUq6S6TCPTiWdsbEGoG8rG k2RUq5I0zXcZ4tLtmb7DpyAGQjIzAdtWmmmhrje809IBv3DLG024PlEnJvdnbZ3xXUMv Xj4A== X-Gm-Message-State: APjAAAXMkmia39j1CXTEbyTicUnB6wkOxxOHMvhNbFFAn5sj3UB6cnpo gE9NGt0a9bB2FCGmBvSG0k+TnQ== X-Received: by 2002:a05:620a:791:: with SMTP id 17mr8488609qka.31.1578758354943; Sat, 11 Jan 2020 07:59:14 -0800 (PST) Received: from Thara-Work-Ubuntu.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id l49sm2843478qtk.7.2020.01.11.07.59.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 11 Jan 2020 07:59:14 -0800 (PST) From: Thara Gopinath To: mingo@redhat.com, peterz@infradead.org, ionela.voinescu@arm.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rui.zhang@intel.com, qperret@google.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org Cc: linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, amit.kucheria@verdurent.com Subject: [Patch v7 4/7] sched/fair: Enable periodic update of average thermal pressure Date: Sat, 11 Jan 2020 10:59:03 -0500 Message-Id: <1578758346-507-5-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1578758346-507-1-git-send-email-thara.gopinath@linaro.org> References: <1578758346-507-1-git-send-email-thara.gopinath@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce support in CFS periodic tick and other bookkeeping apis to trigger the process of computing average thermal pressure for a cpu. Also consider avg_thermal.load_avg in others_have_blocked which allows for decay of pelt signals. Signed-off-by: Thara Gopinath --- kernel/sched/fair.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8da0222..311bb0b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7470,6 +7470,9 @@ static inline bool others_have_blocked(struct rq *rq) if (READ_ONCE(rq->avg_dl.util_avg)) return true; + if (READ_ONCE(rq->avg_thermal.load_avg)) + return true; + #ifdef CONFIG_HAVE_SCHED_AVG_IRQ if (READ_ONCE(rq->avg_irq.util_avg)) return true; @@ -7495,6 +7498,7 @@ static bool __update_blocked_others(struct rq *rq, bool *done) { const struct sched_class *curr_class; u64 now = rq_clock_pelt(rq); + unsigned long thermal_pressure = arch_cpu_thermal_pressure(cpu_of(rq)); bool decayed; /* @@ -7505,6 +7509,8 @@ static bool __update_blocked_others(struct rq *rq, bool *done) decayed = update_rt_rq_load_avg(now, rq, curr_class == &rt_sched_class) | update_dl_rq_load_avg(now, rq, curr_class == &dl_sched_class) | + update_thermal_load_avg(rq_clock_task(rq), rq, + thermal_pressure) | update_irq_load_avg(rq, 0); if (others_have_blocked(rq)) @@ -10275,6 +10281,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued) { struct cfs_rq *cfs_rq; struct sched_entity *se = &curr->se; + unsigned long thermal_pressure = arch_cpu_thermal_pressure(cpu_of(rq)); for_each_sched_entity(se) { cfs_rq = cfs_rq_of(se); @@ -10286,6 +10293,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued) update_misfit_status(curr, rq); update_overutilized_status(task_rq(curr)); + update_thermal_load_avg(rq_clock_task(rq), rq, thermal_pressure); } /* -- 2.1.4