Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2722411ybi; Mon, 17 Jun 2019 09:31:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzn8pP6ylKb1sd/uKgTvXe4geunJ2JyOEoQ8iRnHtunuEMoGdGO66lB0UoN9loD4s8Hkvov X-Received: by 2002:a63:4d0e:: with SMTP id a14mr23197771pgb.346.1560789107761; Mon, 17 Jun 2019 09:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560789107; cv=none; d=google.com; s=arc-20160816; b=wZwRVqV8HN7SADs/9eb1mqkGRoyISrmYqnEGwslzSOnr1Ia06HtmnT0zU+uaRcQwxe WvwXclPRSwaeiRjYsPPk9cGAmgzH7tV72QG+V6lVw+RN0xdN02GPUt+86Pe52Y1HwQ2F yXjfjC7LxrhfVlYJJZE07pPaQ1WBnFUUn/5+l11fEgCN3tOhJ39OH230Jz+s1VV+g4uk Vw3ONJ12ZBVYeOp9ANp79WmhSzjFDZHqqub5S+5zVJyuLZ34YAMupGwyOpZia1MdUSi5 cxr5u+Aex3E7JOd4SXqABdXApmM38ZPg29lqW9WSwQg/79tHBk2oa+Z2OH3BON7fcsf6 prMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XWT7q7gaaCtSTbb2GKGKl3ZbAInUvG98gN+bBKp6/Tc=; b=lSF5QPxFnc1T1Fq7WNLJHBMRPTYYqPkSwMCa5Veyb0iIYtRcvynKhryeXjMpmjDMle WiaMLLS7cW6hA/hjf2iod1LXHeYvaaeGKfFzdiQiDqB+PiGUylXA2cjEISdtm/nSgpAl BEQfxBUXHxsve9rHOL7teUiXro7K1uxdSpkOA8B8mXjlFFBH61EQ5amdKjjoQfLIKsqz mewbhaWVHrSHPXXSX+STfw0D1Efik3H/JoB0DByVi6jkXrW9gd0yf7URSlPWK0JshXb2 iPJcNwbjlQlRpw4u/e707nyZVp2J9mf/sarVI6zwAfur8rGkiPj2WS9QRvWzm303oa+K ponA== 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 3si10746283pli.12.2019.06.17.09.31.32; Mon, 17 Jun 2019 09:31:47 -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 S1727404AbfFQQbY (ORCPT + 99 others); Mon, 17 Jun 2019 12:31:24 -0400 Received: from foss.arm.com ([217.140.110.172]:55768 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfFQQbY (ORCPT ); Mon, 17 Jun 2019 12:31:24 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3BA5E28; Mon, 17 Jun 2019 09:31:23 -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 012AF3F718; Mon, 17 Jun 2019 09:31:21 -0700 (PDT) Date: Mon, 17 Jun 2019 17:31:19 +0100 From: Qais Yousef To: Peter Zijlstra Cc: Ingo Molnar , Steven Rostedt , linux-kernel@vger.kernel.org, Pavankumar Kondeti , Sebastian Andrzej Siewior , Uwe Kleine-Konig , Dietmar Eggemann , Quentin Perret Subject: Re: [PATCH v3 5/6] sched: Add sched_overutilized tracepoint Message-ID: <20190617163119.iawzbpc4pgsoljme@e107158-lin.cambridge.arm.com> References: <20190604111459.2862-1-qais.yousef@arm.com> <20190604111459.2862-6-qais.yousef@arm.com> <20190617155010.GH3436@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190617155010.GH3436@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/17/19 17:50, Peter Zijlstra wrote: > On Tue, Jun 04, 2019 at 12:14:58PM +0100, Qais Yousef wrote: > > 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)); > > + > > strictly speaking you only need @rd :-) Yes. Sorry my brain was hardwired this is overutilized event so we need to pass this info :-) > > > #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); > > } > > } > > But I figure since we need both values anyway, this isn't too much of a > bother. > > I'm going to flip the argument order though. Sounds good to me. The good news is that changing the signature should be doable in the future if we felt the need to evolve it :-) Thanks -- Qais Yousef