Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5280617yba; Mon, 13 May 2019 08:17:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTNT0HMiB+COondhaSd0MY1mWNb2ehqwkEahS5IYslnFehVy+X8lDE1s1rW3mMG8m/E5zd X-Received: by 2002:a17:902:141:: with SMTP id 59mr31409449plb.132.1557760653469; Mon, 13 May 2019 08:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557760653; cv=none; d=google.com; s=arc-20160816; b=CDBJH7FD2gb18Ush6GcZgMsw+2X1KPYwMhEW5dTuOFx93gtzUxKbQ2NL0HTUdVJY5F L140zYRhFl5L2/sGN17xZXp8YIuqE0z1JE90bqUZ37v6ND4pVM6aRbuM4rx8k9v0JAtO GQdTBzi1Ee6aLaqN7tnsFndhIAm+idirZ6VJVetm78wPOtZPA8jfNrCfOoOqwL/5rY+P 99ZKcOum4nfRssFl2xO2Hgxrg0/leDmNpjur97zI8Fi4Ff5TOl0ZoUaEyW2iax3lReFW GxaNBvGH9fF13Bz5L9W3M6mnIKhxbJdxB/hhQ9gDU0SsAdV9Nci8MswCODHDU9S3kG/b yluA== 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=x8JCVTT8voG0p24JoSGdqK04Odjp831s9TvpCJKY8Q4=; b=UpWj/xvNXXIy+/JDAiv97IBOM+jV6OuE38i7gQ5w4BNZXRkOAHrBoi+x6o85rJDQCF 4wEjANvAEnOiYluf+NAXB9UoWe/IXcHnHVHhAGdlh7qOJHDX2PrrsBFj+kPz7Tce4iwL PdeczlCzsopih6QUCD39vNzb60AXrRUZcustqZIfxiUab6hvQtHV6GjpPhw9ijOH4pYG bq9nVNYyn2SN4XrttSLcNvadL4AxS5xmLfZmd6sEVxFC7foOq+lba0iiqmoxgiBIOBxG 1B0SNXQdp3fnqjEQ6oC0zR55ye2vVGAvCGHKQOmu4VwsvmsknTvtVmZ+F+S3tTAibp5T uOgA== 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 q205si20259451pfc.151.2019.05.13.08.17.17; Mon, 13 May 2019 08:17:33 -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 S1729356AbfEMMmf (ORCPT + 99 others); Mon, 13 May 2019 08:42:35 -0400 Received: from foss.arm.com ([217.140.101.70]:54934 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728015AbfEMMme (ORCPT ); Mon, 13 May 2019 08:42:34 -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 8D98380D; Mon, 13 May 2019 05:42:33 -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 E3B4F3F6C4; Mon, 13 May 2019 05:42:31 -0700 (PDT) Date: Mon, 13 May 2019 13:42:29 +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 v2 6/7] sched: Add sched_overutilized tracepoint Message-ID: <20190513124228.a2imudj6ji3khnfg@e107158-lin.cambridge.arm.com> References: <20190510113013.1193-1-qais.yousef@arm.com> <20190510113013.1193-7-qais.yousef@arm.com> <20190513120830.GS2623@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190513120830.GS2623@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 05/13/19 14:08, Peter Zijlstra wrote: > On Fri, May 10, 2019 at 12:30:12PM +0100, Qais Yousef wrote: > > > 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); > > } > > } > > Note how the state is per root domain and the tracepoint doesn't > communicate that. Right! I can pass rd->span so that the probing function can use it to differentiate the root domains if they care? -- Qais Yousef