From patchwork Fri Mar 16 11:25:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 131920 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp617946ljb; Fri, 16 Mar 2018 04:26:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELsqREG/qmOTt8M7gbYu7OFmogJxcXcvohVBE4SSqBa5+lc4f6/zt86Z5GCXF0av3vtNVJeR X-Received: by 2002:a17:902:5410:: with SMTP id d16-v6mr1777867pli.176.1521199586849; Fri, 16 Mar 2018 04:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521199586; cv=none; d=google.com; s=arc-20160816; b=Ne0/kBYjzHknG22iDeD4ghbc8bywpV9CDIKEa7Vcit3nqrmkISjAGDQax1RpnVavOq dqvVpN58XunGuuA+1dZjcbpvihBmm+YMk6ZpxkFlb7TJB2QDZawMISG06QNIDLh6VFvr Lmh4dmnTe9wwwI7IQYyNttFTl0zIYYDp7tCyVaD2sXQEqf9SNlHJqQadUVEpqkzzAVuQ oU9x9rwAHqWRmMSqFWSkQZDTLpMJ5WqnnZKEe+yVZ4ZbrK/amhwNB4VB8TnVUqBwTWK4 kPj8G52P8y4c3uR/khCdBZOmqocaddj/LPZCNzUSwSYg/5oQGthObSVE+SU/mKHeymTP KQhQ== 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:arc-authentication-results; bh=YVPi8OgBu68Jkd23UJvd5V3jRLSOcdW5cQfj/S6SEKU=; b=twBl1DXrP4RP/Xra7LX6iHnQ4n47SbvX4UT1fGyO82Vink4XTEVEOCk8WZT9FQHa2c ZvIw7NulyRtTuxJDzz68CE/VBY9PGcy5JUASzOEPnVA8MEN+vVjmQREAagy1CoNXgM2H ha+//ZA2baVNQCaDqGUUEFws/h51nqkWt9jLY+1y5Th4mdELROhrmfjPZL7w7anjVB3w STTExsP6BnfYWIAs8UCt96p1JxZiT5duF9Fbf6HQgrOcauLX5qmmmJoXM3clI8V/t69H j/jBTQJzNu0qot6UXmBNslcmHUyL5cnD3nCCvuqvZcPPKg9l3UXvIyUYsKC7U0gYtP2B SupA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WizJijMt; 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 33-v6si5109684pls.491.2018.03.16.04.26.26; Fri, 16 Mar 2018 04:26:26 -0700 (PDT) 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=WizJijMt; 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 S1753931AbeCPL0X (ORCPT + 28 others); Fri, 16 Mar 2018 07:26:23 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:46423 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753887AbeCPLZ5 (ORCPT ); Fri, 16 Mar 2018 07:25:57 -0400 Received: by mail-wr0-f196.google.com with SMTP id m12so11274522wrm.13 for ; Fri, 16 Mar 2018 04:25:57 -0700 (PDT) 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=YVPi8OgBu68Jkd23UJvd5V3jRLSOcdW5cQfj/S6SEKU=; b=WizJijMth97uFiqg3FZJQzeIAoNK0Njj85+CcvA6nGXtLrEO0qhyfebYn/RFihBke9 FUzQZTueZr0KIXHHD5LKQtvNSSPr++1Fcs5hIQDDVvFZVNudnsEUKklrhu0No9cwQnlU fi1cRTBDMyy7LE18JwjxEUCcDpMNDB1lop6YU= 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=YVPi8OgBu68Jkd23UJvd5V3jRLSOcdW5cQfj/S6SEKU=; b=hsVsp54dwQQkkOwmb+kP5n/0qni1kClQt2b/ZIOdCb+fmrVgGMlzPCSMG7Oxrba6OG gm+4TjGd5JrYP3/3GPiyS98MFkXlX5k4AK1STiehu3yh749Iiy+Erym4V25XT8TctwyV rRw5p9Uc0L+rwVcJ96GD7IE5jEe93A2PzJiqyDzxaK+9L77NJ9rFYd7bYwQ8oJreaprb vxeMSeM1r5iV3auAm2fgIScJ0KbinTh55bpj/1+bcRJKSdtybLNdSemJVv4mb6004xd7 96En81ScSKB3bQNHc78XvgO1RgSS98t20Q1Ad3ByzYGMLoUXG+JAGHUGIXz0R8F1yi08 qRgQ== X-Gm-Message-State: AElRT7G8bTygcaCPC8fasZ5Gvdl2/gI58yYtI5sd8KhyKNJoHeDXF+oP cFvT4ksLCRgo8cRJzWL8keE1/g== X-Received: by 10.223.153.167 with SMTP id y36mr1323896wrb.136.1521199556616; Fri, 16 Mar 2018 04:25:56 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:9471:2e09:99e5:f59]) by smtp.gmail.com with ESMTPSA id m15sm6785292wrb.58.2018.03.16.04.25.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Mar 2018 04:25:55 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, rjw@rjwysocki.net Cc: juri.lelli@redhat.com, dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, viresh.kumar@linaro.org, valentin.schneider@arm.com, Vincent Guittot Subject: [PATCH 4/4 v4] sched/nohz: monitor rt utilization Date: Fri, 16 Mar 2018 12:25:41 +0100 Message-Id: <1521199541-15308-5-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521199541-15308-1-git-send-email-vincent.guittot@linaro.org> References: <1521199541-15308-1-git-send-email-vincent.guittot@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Take into account rt's utilization when deciding to stop periodic update Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 60e3c4b..3f00e03 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7131,6 +7131,14 @@ static inline bool cfs_rq_has_blocked(struct cfs_rq *cfs_rq) return false; } +static inline bool rt_rq_has_blocked(struct rt_rq *rt_rq) +{ + if (rt_rq->avg.util_avg) + return true; + + return false; +} + #ifdef CONFIG_FAIR_GROUP_SCHED static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) @@ -7191,6 +7199,9 @@ static void update_blocked_averages(int cpu) done = false; } update_rt_rq_load_avg(rq_clock_task(rq), cpu, &rq->rt, 0); + /* Don't need periodic decay once load/util_avg are null */ + if (rt_rq_has_blocked(&rq->rt)) + done = false; #ifdef CONFIG_NO_HZ_COMMON rq->last_blocked_load_update_tick = jiffies; @@ -7259,7 +7270,7 @@ static inline void update_blocked_averages(int cpu) update_rt_rq_load_avg(rq_clock_task(rq), cpu, &rq->rt, 0); #ifdef CONFIG_NO_HZ_COMMON rq->last_blocked_load_update_tick = jiffies; - if (!cfs_rq_has_blocked(cfs_rq)) + if (!cfs_rq_has_blocked(cfs_rq) && !rt_rq_has_blocked(&rq->rt)) rq->has_blocked_load = 0; #endif rq_unlock_irqrestore(rq, &rf);