Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1998288yba; Fri, 10 May 2019 04:48:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/9hLk7959KnAthU9m/hDKA1hwJx2q+WSm9VIq3ruTcx0/W4N4l3jU48kXtlOrY+1UvRH+ X-Received: by 2002:a17:902:b695:: with SMTP id c21mr12486329pls.160.1557488939319; Fri, 10 May 2019 04:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557488939; cv=none; d=google.com; s=arc-20160816; b=imiYecQ5joEKk4VK0k4P8QfB2Trakn0/dZvNdtOpkWobWsFTRyDC/2uadfngQtTpnL k7XxOnbpt5lqRVz7PT1oTApZRTDv7BzczaCqRC7YWOirfp+BdO0e+oo4hOSnCuQowVsp qDmaaRPQjxYS3Z0r8cR0I1PS1PW/1YjYbsQctKEMdOC8Q6MChOSQ91sYAjFKXVnXBh9c GnB58QyjBS58kGn/3JyJlIizsD+7I1j/QP0A46AlQnZ3xgIg2UJsv68xEcu+U42QP36H ayt+8L1oQ0VaQBsgjKPSexOPgysCD+nic/2hbUtLUB4RETRJoPqsh+NHaciiCahu3f4P pN0A== 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=SUPD/ukmMn9JJKNzP1+tWW22P9wZby26qN+ieeuMfxs=; b=APMoPZ/rz71LaM4GELBAK+jaP5/CsIqmxsgacd2xvcgUeIvfvrskk0Nwp9D9NIlM7F 62wbSpbVJ5RLapuLTSCbuxvy0NpulL2AwW/lEk6imTrvgxNoeQwiVc4HxJ/7NeuVYjJe yBfndt/8Ow+jGYbYRrHMgoZoJIPKPSGcfQ5Ja40Sd6w56YIjoh2NtysmJuxLeJiGVzDE JjFsVm0rMvnTuajJnSGS6l41oWBf2/4SB5+x4aEphn8YPtpTrKb2Fi9TnblALyb6FnMg I0QVbjWqR3JubMQPnBqLB4iUQ38TufPkPrORFywaOfxY6o2FWk39/q2LgXmvZqxWXfnb m3AQ== 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 o19si7577789pfi.106.2019.05.10.04.48.43; Fri, 10 May 2019 04:48:59 -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 S1727593AbfEJLcs (ORCPT + 99 others); Fri, 10 May 2019 07:32:48 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44570 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727529AbfEJLcq (ORCPT ); Fri, 10 May 2019 07:32:46 -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 9950219BF; Fri, 10 May 2019 04:32:45 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.194.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1C9FD3F6C4; Fri, 10 May 2019 04:32:42 -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 v2 6/7] sched: Add sched_overutilized tracepoint Date: Fri, 10 May 2019 12:30:12 +0100 Message-Id: <20190510113013.1193-7-qais.yousef@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190510113013.1193-1-qais.yousef@arm.com> References: <20190510113013.1193-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 | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index cbcb47972232..0cf42d13d6c4 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -600,6 +600,10 @@ DECLARE_TRACE(pelt_se, TP_PROTO(int cpu, const char *path, struct sched_entity *se), TP_ARGS(cpu, path, se)); +DECLARE_TRACE(sched_overutilized, + TP_PROTO(int overutilized), + TP_ARGS(overutilized)); + #endif /* _TRACE_SCHED_H */ /* This part must be outside protection */ diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 81036c34fd29..494032220fe7 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4965,8 +4965,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(1); + } } #else static inline void update_overutilized_status(struct rq *rq) { } @@ -8330,8 +8332,11 @@ 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(!!(sg_status & SG_OVERUTILIZED)); } else if (sg_status & SG_OVERUTILIZED) { WRITE_ONCE(env->dst_rq->rd->overutilized, SG_OVERUTILIZED); + trace_sched_overutilized(1); } } -- 2.17.1