Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1129932ybx; Tue, 5 Nov 2019 10:50:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxWDA+X0O1nzD6xVsNqVOtqrqUYWoHh4sGQtUIV8ucRi+Om3XW7PXJCfetnLd/pSSWsMY0c X-Received: by 2002:aa7:dcc4:: with SMTP id w4mr27722582edu.161.1572979857414; Tue, 05 Nov 2019 10:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572979857; cv=none; d=google.com; s=arc-20160816; b=OO6D4On+NGYpkQHYwL31RW/jdwCWZzmVxU3aakaxaU3W1+K48P1YoY2tPMZiKZOjDH /Rbp8XQhSf3L2s/pTwkNglRkJ2p+NSIkQO7OXGb1UDeaUn5i2p5nEgiR1pYjF/7jauoE Vz+NEktRfzSvOpp/5wM5JEDxFWVSVWyclMAFulNtu+syGRQWfwuFZ+vHRvXqXGHEJ2Lr jU2lb80BmtQzVB4X7QhavXs9151YKgPdGYgUz+EAItnNKTH/Ijz13KZP3WblBl6XBYxj 0cHV9g3FpIEZvFMHF7HjyUqYeMmU3/nmE4PQxTRkkz3nvTWSk3nRG8KVzkwKsrscNc3s GC3A== 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=006+GihIsoSJvx8BvSuuRbmJ7qmM9mq/EsT1uZpB9E8=; b=IQWzUKqn+n3ofLf05zhowCrYtaKZPuafaNXIdRoJ12aSKbwPpLkgwgRAcfmouWVfjw UpARQgt40x2sq42Xo6DhFk0s1jX+SHp2jZhSFZGiHYDdtcBtosuxHxpIP8Esz0bfducJ F/URvjhDhGk6fhyymXvLW0obVlhAzXDY0G2JhW4egQNCU1MvBt4GjhxCS7sIa7wsTKXs Tt1zfLAIqO4NKK57l0ytqZc302ttZTXARNrg2N6DY4gP7qPvtLvGt1fufpFvE3WWY1EU RlKwlY1XsKkiyeKNcuQEry3FOmIP6DpBVfrVUe28Ny7JHHg1gvpDzL07PJ2r6r9MEMie xwXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=umHITE8R; 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 e22si6385591edy.0.2019.11.05.10.50.33; Tue, 05 Nov 2019 10:50:57 -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=umHITE8R; 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 S2390814AbfKESty (ORCPT + 99 others); Tue, 5 Nov 2019 13:49:54 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:39611 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390804AbfKEStx (ORCPT ); Tue, 5 Nov 2019 13:49:53 -0500 Received: by mail-qk1-f195.google.com with SMTP id 15so22135530qkh.6 for ; Tue, 05 Nov 2019 10:49:52 -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=006+GihIsoSJvx8BvSuuRbmJ7qmM9mq/EsT1uZpB9E8=; b=umHITE8Rim3P3C0vmPd1bi4DZRx1zdTbqjCJvqS24wBoTsh8ON4lbclj7QoYR/LAXt v81irwxh0cnz10y3uLwQ1f59uei8i1cknodeK+rMgBjswpicXC3nz77LMLSB14C0iObr q7NBo8rxaVDqt3gi9FAeWlL8mZu2A1c19m9C3yDhNftBac5oeJNUf0Skpfg9Y0MO5iP1 f/NkI59MrPdaqfE193YlsGkC9NXaF0e7zO7YGBzhEI1UI3HqErcbcca8k2TjS9WkJRNp Osy4rOGNuTSa8CqqR0cF1OkuCJfbgYtDwS6rdcp24yQjN6W+Lx29FHqqDNJcg4Xe/crU MkhQ== 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=006+GihIsoSJvx8BvSuuRbmJ7qmM9mq/EsT1uZpB9E8=; b=scZ8O3heyI0TvstdZh+b8rLESMaG5m6YJxkZNJJalbmPnQih4XJawKt386PHU/HVNW 4ka9kBCEdOKzj7Vhz3skO4CvTegFegwf8O+oABUXuxvWGn/UmsMq476NziLUqv6n/aIL bZr08/4NuFQrZGN2263BHlIp3ueiUystTI8W+qV3BIhCFi2I8/8sKIP2fh9DTtJnVgXd MSgMR4cUGxeeiOQVsJ93Cq3fS+PWvTATd3Gs2FSqZCs8W1P9RwjFGG0dcPL9/mwjcWEQ 04nvnpLtfkM4WpwfyWnw//rWq6iSRjV3ysr1STUZ6hkEx8n9yB7Yy+DDEBhiym90GXGQ snKQ== X-Gm-Message-State: APjAAAWoWDsCb9PkjYJNSUjTbqfqa6b1W7Nt5I8x3FJT8Eor1IqPUajq I6MmNN8fJmN3ziUvH+549cVZ/g== X-Received: by 2002:ae9:e109:: with SMTP id g9mr6485852qkm.50.1572979792141; Tue, 05 Nov 2019 10:49:52 -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 j7sm6832565qkd.46.2019.11.05.10.49.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Nov 2019 10:49:51 -0800 (PST) From: Thara Gopinath To: 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 Subject: [Patch v5 3/6] sched/fair: Enable periodic update of average thermal pressure Date: Tue, 5 Nov 2019 13:49:43 -0500 Message-Id: <1572979786-20361-4-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1572979786-20361-1-git-send-email-thara.gopinath@linaro.org> References: <1572979786-20361-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 --- v4->v5: - Updated both versions of update_blocked_averages to trigger the process of computing average thermal pressure. - Updated others_have_blocked to considerd avg_thermal.load_avg. kernel/sched/fair.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2e907cc..9fb0494 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -92,6 +92,8 @@ const_debug unsigned int sysctl_sched_migration_cost = 500000UL; */ static DEFINE_PER_CPU(unsigned long, thermal_pressure); +static void trigger_thermal_pressure_average(struct rq *rq); + #ifdef CONFIG_SMP /* * For asym packing, by default the lower numbered CPU has higher priority. @@ -7493,6 +7495,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; @@ -7580,6 +7585,8 @@ static void update_blocked_averages(int cpu) done = false; update_blocked_load_status(rq, !done); + + trigger_thermal_pressure_average(rq); rq_unlock_irqrestore(rq, &rf); } @@ -7646,6 +7653,7 @@ static inline void update_blocked_averages(int cpu) update_dl_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &dl_sched_class); update_irq_load_avg(rq, 0); update_blocked_load_status(rq, cfs_rq_has_blocked(cfs_rq) || others_have_blocked(rq)); + trigger_thermal_pressure_average(rq); rq_unlock_irqrestore(rq, &rf); } @@ -9939,6 +9947,8 @@ 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)); + + trigger_thermal_pressure_average(rq); } /* -- 2.1.4