From patchwork Tue Nov 5 18:49:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 178550 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1151398ilf; Tue, 5 Nov 2019 10:49:59 -0800 (PST) X-Google-Smtp-Source: APXvYqwk55aygcQMESXqAD9r9wQrEh5L6euIdK/i5hHIwy8fRp2hNBPLsr2XBY3ev6wHW8DL3ULt X-Received: by 2002:a17:906:a40e:: with SMTP id l14mr10024684ejz.168.1572979799183; Tue, 05 Nov 2019 10:49:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572979799; cv=none; d=google.com; s=arc-20160816; b=M7VFEzKiWgJFCwPZz9M5iS8R+zby+bX3Qk64UNDwlbAEhQDIQjMQZgg+WqD8+wdJPm FUAS5ABv7DB8HzsYaSc6IgHroDJZAGlJcXPGO335j+Kumtqd6LVR6rxiqeM8a3tvplxM E8sEM9EK4zuA+z9GB5KxndDRlVH3BfD0UlkW6Gz/rbb2Q8+0ilJ0X/GrLj9EEvLAXl2h zDxpyDFCgOabtWz1DZg4MmZ2QBJxESoKUGwwwJPWCea4wHG1wYM/OA85N6RDhe+DGiw9 ND40hrTVblP2yMHJWx8A+qU6ykmaVbvL6C5+7G9Ns3RuSA/NsctztaLjkZ+e0Bh3dmD/ w+yQ== 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 nj2si13921473ejb.233.2019.11.05.10.49.58; Tue, 05 Nov 2019 10:49:59 -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 S2390817AbfKESty (ORCPT + 26 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(+) -- 2.1.4 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); } /*