Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5277921ybi; Tue, 4 Jun 2019 04:18:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNHcTd/rz5aScTm/rCOih9Ez1P264kfw0APUBVaMHFao+bzlMkF1lyO+bF6h+y3oPsqnIX X-Received: by 2002:a17:902:b101:: with SMTP id q1mr9891145plr.219.1559647114995; Tue, 04 Jun 2019 04:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559647114; cv=none; d=google.com; s=arc-20160816; b=CLZAhNTEcfR5Az8pt6ipCoyrh9/Y4oOkN8mj19JRClnqQn9eWh1TThMeTaz8N8ZkGu T6wrCMEtS4fePLnuiTxBbJhXX0z9GntnOqyRFRcqd+sQbVkFph/TBMZn3efCumDeM5yJ NNrZ2UjcLvRVgbxov15oE4lxWbFDprlHguYSQJjIZYtElb1sqmkgiKuLNhjQ6pCpaXmY g3i0ftvmrW4S1K+rRe6QAMcUe+iP+s69bT7tGQZ3Ict7BxsRWnfhT4ZIXc4LniAaQjvh qqtYhVOPCsayyG8f4hY9K63UNxzrUjiwcTfObPJJoCHAZLS2lhDQUhyNIYMmb1j7lZIs OPEw== 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; bh=bcHnVSpGzpWSKAIjWRFtvwby04m+4G0vjDhlQLzNjQQ=; b=lI7jzkp8olCuKWERk1VGf4HNQLhfv0eZZPW6uZyKtgE7Ep8rvMYUcK7JJNXdPLToC9 kfvE3hwl+xXVv2Ij55ziV24AJzTpUD8Egm4yCAQ6ObB7wDr3eeHXJTiNB6DNpOjbJyrt pPttEWcShHquG8rZolN2+deL0NIgQga6tbWyDkKW19MTbr3+2yP6xUG/Dbvk0UbRTho0 CZCtM/2mbNmoI49+6JzULX8ThtQ5JjuQNfjkiOVIqwkRNxVSNyQLjcm+m2XPbEmvd3rD 1EhNNKHkVmT8asMV26TG6G9ium62lnBuWnW10FYfU4/IZne7fKrCijygat+VEn2JYiUM nCJg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r25si17079422pga.294.2019.06.04.04.18.17; Tue, 04 Jun 2019 04:18:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727613AbfFDLPU (ORCPT + 99 others); Tue, 4 Jun 2019 07:15:20 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:40592 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727548AbfFDLPS (ORCPT ); Tue, 4 Jun 2019 07:15:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 788B8169E; Tue, 4 Jun 2019 04:15:18 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.51]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AAAB93F690; Tue, 4 Jun 2019 04:15:16 -0700 (PDT) From: Qais Yousef To: Peter Zijlstra , Ingo Molnar , Steven Rostedt Cc: linux-kernel@vger.kernel.org, Pavankumar Kondeti , Sebastian Andrzej Siewior , Uwe Kleine-Konig , Dietmar Eggemann , Quentin Perret , Qais Yousef Subject: [PATCH v3 5/6] sched: Add sched_overutilized tracepoint Date: Tue, 4 Jun 2019 12:14:58 +0100 Message-Id: <20190604111459.2862-6-qais.yousef@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604111459.2862-1-qais.yousef@arm.com> References: <20190604111459.2862-1-qais.yousef@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The new tracepoint allows us to track the changes in overutilized status. Overutilized status is associated with EAS. It indicates that the system is in high performance state. EAS is disabled when the system is in this state since there's not much energy savings while high performance tasks are pushing the system to the limit and it's better to default to the spreading behavior of the scheduler. This tracepoint helps understanding and debugging the conditions under which this happens. Signed-off-by: Qais Yousef --- include/trace/events/sched.h | 4 ++++ kernel/sched/fair.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index c7dd9bc7f001..edd96e04049f 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -621,6 +621,10 @@ DECLARE_TRACE(pelt_se_tp, TP_PROTO(struct sched_entity *se), TP_ARGS(se)); +DECLARE_TRACE(sched_overutilized_tp, + TP_PROTO(int overutilized, struct root_domain *rd), + TP_ARGS(overutilized, rd)); + #endif /* _TRACE_SCHED_H */ /* This part must be outside protection */ diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8e0015ebf109..e2418741608e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5179,8 +5179,10 @@ static inline bool cpu_overutilized(int cpu) static inline void update_overutilized_status(struct rq *rq) { - if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu)) + if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu)) { WRITE_ONCE(rq->rd->overutilized, SG_OVERUTILIZED); + trace_sched_overutilized_tp(1, rq->rd); + } } #else static inline void update_overutilized_status(struct rq *rq) { } @@ -8542,8 +8544,13 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd /* Update over-utilization (tipping point, U >= 0) indicator */ WRITE_ONCE(rd->overutilized, sg_status & SG_OVERUTILIZED); + + trace_sched_overutilized_tp(!!(sg_status & SG_OVERUTILIZED), rd); } else if (sg_status & SG_OVERUTILIZED) { - WRITE_ONCE(env->dst_rq->rd->overutilized, SG_OVERUTILIZED); + struct root_domain *rd = env->dst_rq->rd; + + WRITE_ONCE(rd->overutilized, SG_OVERUTILIZED); + trace_sched_overutilized_tp(1, rd); } } -- 2.17.1