Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2681858ybi; Mon, 17 Jun 2019 08:50:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOJ+/3s70Qr22fT5OlLiFVDWQO1LlzqyFVcbCeKrvrYcBktDNRt/+ASwYyE4SjAIxeiM/k X-Received: by 2002:a63:1462:: with SMTP id 34mr15937279pgu.417.1560786655113; Mon, 17 Jun 2019 08:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560786655; cv=none; d=google.com; s=arc-20160816; b=t5zjIkYyVJjFyHb71y3RQUi1kVFxhGRvdnIdk0j2cjo5It4mK90S/BVHzDejPcXrEK QCzTnF4bhcvcztA+GtFsCDM2ZkPKGCG6LhhpyOZKmGROlmViip9lf+NGClshUJq1obBt K6qLpO3d0w80kN/OtJJSCxlI0xJN5IljU8WwuaRggulovnCEU9N22JkgaJ5dvTf+hDDP 4C+S6+hKxN2ly5XvalJz2OtNP+QaPaCP6sa4H6WoG63eMB7tb4nPljGkxtxNzbsXPW0v 7NGbra290W32o9CWY3dn/rH/UgIDN14I5hcZnv1/LD0qS5ycwEYQ1qnBMtvkno87VruS DyXA== 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:dkim-signature; bh=BR2md6n6Q18on79dMFcaXNz3srYx6Sfx4K07iFPAszA=; b=HGu4gjofxcWgwT90S3DQ3epNw+61i/TeA4IGhynhLgSlcaJcALDvi1lzoFG1PQwG4k v3ZkQuD3MmaElnfzRb/JhQa8jpxkHIcP8p1DSYc4YpxcNUDH/i3w3MmWsustQ7YAXFjg OydX2nfJNCa0Vmv9HFDMFEX9SqSTMxMoJukDi48KbMbXEv0FuE4TYKxUnKov2CFUcclm Zo4274QmVpDk2I3G+f5MEFwPnRLUofAto9pWpDEALl5BqfIzMj9+Xd3dE7ptE1SiHymp yAiqE7iUDYjbTmGzEx80+R1VZEohuifqxWd5uyBm3DweAy7nbEeduDxzW/y0NeMK32bi XQ6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Q9HxfQrq; 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 y11si10457036plr.381.2019.06.17.08.50.40; Mon, 17 Jun 2019 08:50:55 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Q9HxfQrq; 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 S1728410AbfFQPuc (ORCPT + 99 others); Mon, 17 Jun 2019 11:50:32 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39196 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728248AbfFQPub (ORCPT ); Mon, 17 Jun 2019 11:50:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BR2md6n6Q18on79dMFcaXNz3srYx6Sfx4K07iFPAszA=; b=Q9HxfQrqVz+qo4SCuT0oYOUGY s2zAOLRSQbww5wegoEzCwYdsqD7jW6FS56wDaXTzTFCAOd+Hi0z3HWWssf+Gn2Ilf3bfFHLug2JP7 +4LTrS5GXNNupL0/8f8fqBt3TYUmoICe5y64Vgbmg9h6WXWsp6eQb/+4/hj1B33TR8czRrK8vvlLZ COXJJN+qpkiM5eEhvQqoIeardkUme6LKIOgjCvEma1iklypdDJverql/CC+FYraT0j/Gb7osmIpnK Sb+miWQ6wXmNPCTaqqK9ykDY+KkFid/Skbutgsu7KAprjgGp7sweQWo5p7xt8fRgIM83+Fg1MR1Bs UyDwHJF3w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hcttc-0007YJ-4V; Mon, 17 Jun 2019 15:50:12 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7D6CE201F4619; Mon, 17 Jun 2019 17:50:10 +0200 (CEST) Date: Mon, 17 Jun 2019 17:50:10 +0200 From: Peter Zijlstra To: Qais Yousef 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: <20190617155010.GH3436@hirez.programming.kicks-ass.net> References: <20190604111459.2862-1-qais.yousef@arm.com> <20190604111459.2862-6-qais.yousef@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190604111459.2862-6-qais.yousef@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 :-) > #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.