Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3462827imm; Fri, 25 May 2018 06:13:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo3ELfZWilQ/MLB0hm0VDAqDkI9UlYCKQx0rb34DCdYZ2SpoVaO0kz+cE++nvr+k7FETapx X-Received: by 2002:a17:902:a582:: with SMTP id az2-v6mr2569142plb.98.1527254001037; Fri, 25 May 2018 06:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527254001; cv=none; d=google.com; s=arc-20160816; b=X1XTFiggWxG9sJD19ba9I+NCS9uac/GtsA42X1+Oz5eDz4d5veWhgusPGCWOoI54Ss KmLH19iRwWzX6+GZpOxadQBcEZ9Lb+IcrQ8E+wbyeXSpodAMyLlIQmX5XP/ic7FXdyZN 1CcZowhUj0i2PhhUmkNTLwi+ppAmFkKXnMfX/rTWI5HZEz9w7KxdqTADpxlDtApkALWZ bmTYtLH7G5PGUnxXncVr2EDbtk7+9QES/D7MGwrSRcadDcxfu00FojR0/Xq7qooSxZYt UPHhUI5NWmUAtt3cUFBJnji7fkXMC5ijQWgudlIwSYDtFx5SzQaIsGprY7LLPrZ8bwfp R6tQ== 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=MEPsXVmZpqP0Xgk5Bm/UwwtvRJPoyAU0RMu6cyOEOMc=; b=dRQIRutDD4OciGHRHUEpkufdWuuULaztarjBGVRpE4SeLi51FueVG423puA78ABb7b zvwnOyloevdiVvE0P5WsNBhJ4zHYgJmKjFXNk0vJC4XUz8MN0JIsS5/rP0O6+YWvKMIu 8FxxVOJFe/h0Lsf0y1k2M/f1v/jNMaEXvPlOYeD5gL/91G1cyWAPgRGH7Tl4ajtZed5t /71eB1Zmd9Lm7/t+f59mFcb9CFTxR5lC5seJ0n7ZwWcwp9XngUpAFDd3nqMc/o+ThSX5 8pTpfAxiy3iNoueKZt1LiesFejHIaR9vY7RTt5uU5btwUFX0192lhlXVdvtgM8KnfITe Vtuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NmZw9LqP; 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 t9-v6si24371668pfk.228.2018.05.25.06.13.05; Fri, 25 May 2018 06:13:21 -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=NmZw9LqP; 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 S935972AbeEYNMw (ORCPT + 99 others); Fri, 25 May 2018 09:12:52 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:39024 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935167AbeEYNMr (ORCPT ); Fri, 25 May 2018 09:12:47 -0400 Received: by mail-wm0-f67.google.com with SMTP id f8-v6so14525754wmc.4 for ; Fri, 25 May 2018 06:12:46 -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=MEPsXVmZpqP0Xgk5Bm/UwwtvRJPoyAU0RMu6cyOEOMc=; b=NmZw9LqPm2pQWUN02Q9PrFHTxcHvvUOKBGz64KaaBegj/OXjjs332ZswkdmX0nSn/e NxJbnMiqHCqED5UFO9Bof3KWfM3A6O+p3BAWy2xw8MJmOe4f6PilxgAkZKCMJfUyJ2U3 UMTGdgTYfFo5GInGi7QL99dyAJGeI/swlC9HM= 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=MEPsXVmZpqP0Xgk5Bm/UwwtvRJPoyAU0RMu6cyOEOMc=; b=IxKDHHENVarYUKg0rxlmfaIUVibHARREorLl/+6yJMdDU2u2C3QtLvzu4ulpURNfl+ 1jucND//LGDEWbI6TQFZZor6HISAA3kYN4toMNCsjQ7yWFgCYqV/b4Nr+RCUzUVM19ck /AWMvIQadX6wNbln2/tekTlsBqEGfDmn1NndjKKuNTIR9Jr91rOXVeNlFOw4z7+MqtIa Qd4fQkfsbSRb8j3RRU4opOmutPfPoe8xIZ0kFK4KZSHtKSxOAcuSg6UbXDu2tsayyLQp kaJQw+BREXCnVnECfDKodf/Gsy9B+ahD+2OKtjddu/99eQ46Y13hoNScWf7k7v5NQVDB mACA== X-Gm-Message-State: ALKqPwesF8LcOHAMrvriPn8eBFAAB0c8er/ipBp6XbA9EG6x/D8mOrXU BkGskWpiuMqpOGeweyEF0yHO7A== X-Received: by 2002:a1c:d755:: with SMTP id o82-v6mr1558388wmg.71.1527253965986; Fri, 25 May 2018 06:12:45 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:a860:64b4:335b:c763]) by smtp.gmail.com with ESMTPSA id 4-v6sm9690948wmg.8.2018.05.25.06.12.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 May 2018 06:12:45 -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, quentin.perret@arm.com, Vincent Guittot Subject: [PATCH v5 06/10] sched: remove rt and dl from sched_avg Date: Fri, 25 May 2018 15:12:27 +0200 Message-Id: <1527253951-22709-7-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527253951-22709-1-git-send-email-vincent.guittot@linaro.org> References: <1527253951-22709-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 the utilization level of the CPU by rt and dl tasks is now tracked with PELT so we can use these metrics and remove them from the rt_avg which will track only interrupt and stolen virtual time. Signed-off-by: Vincent Guittot --- kernel/sched/deadline.c | 2 -- kernel/sched/fair.c | 2 ++ kernel/sched/pelt.c | 2 +- kernel/sched/rt.c | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 950b3fb..da839e7 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1180,8 +1180,6 @@ static void update_curr_dl(struct rq *rq) curr->se.exec_start = now; cgroup_account_cputime(curr, delta_exec); - sched_rt_avg_update(rq, delta_exec); - if (dl_entity_is_special(dl_se)) return; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 967e873..da75eda 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7562,6 +7562,8 @@ static unsigned long scale_rt_capacity(int cpu) used = div_u64(avg, total); + used += READ_ONCE(rq->avg_rt.util_avg); + used += READ_ONCE(rq->avg_dl.util_avg); if (likely(used < SCHED_CAPACITY_SCALE)) return SCHED_CAPACITY_SCALE - used; diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c index b07db80..3d5bd3a 100644 --- a/kernel/sched/pelt.c +++ b/kernel/sched/pelt.c @@ -237,7 +237,7 @@ ___update_load_avg(struct sched_avg *sa, unsigned long load, unsigned long runna */ sa->load_avg = div_u64(load * sa->load_sum, divider); sa->runnable_load_avg = div_u64(runnable * sa->runnable_load_sum, divider); - sa->util_avg = sa->util_sum / divider; + WRITE_ONCE(sa->util_avg, sa->util_sum / divider); } /* diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index b4148a9..3393c63 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -970,8 +970,6 @@ static void update_curr_rt(struct rq *rq) curr->se.exec_start = now; cgroup_account_cputime(curr, delta_exec); - sched_rt_avg_update(rq, delta_exec); - if (!rt_bandwidth_enabled()) return; -- 2.7.4