Received: by 10.213.65.68 with SMTP id h4csp2396415imn; Mon, 9 Apr 2018 02:53:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Kkk47XVmPEmdhw1cC8dB4d3IDvKOhV6M7MOzkKGwcGM4ufk2h0A84q2kKrRyTN/019h2u X-Received: by 2002:a17:902:108a:: with SMTP id c10-v6mr38306540pla.22.1523267617265; Mon, 09 Apr 2018 02:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523267617; cv=none; d=google.com; s=arc-20160816; b=BtruaBoEbCrrjfbq8b+1u2G7isM3TOlV98k5v42FwNtguaF7DNg9UwK8lWIWoFn9R0 FgK5gZHyZO06epmM8lkgudRt31XfbFk+e0Fdm8A/2DQCYgpdb4ybj/5YjP4o/2q7u055 nimhLebu3hbuvYVVCkPgW4Vq0YmVnXRJVVuT+wNaTXncD2XjzcEhenE2svy3+TP0m46e gW/bqAl5YKj73X4wrpNrjnW/+dpm563jT9i3t5kXrvmjYfHgcyzQD2OTvuMCo70bbtc0 4vPv+dXpYRcMfLImZP2albPkinFgFWSBF/x6qdkEMKKCLdXK3rAaMtagY46bfis3mrCO c0+g== 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:arc-authentication-results; bh=VMFDYTUk+pxvY0RuMw5ZPsyYLaVZMd4pJKh+9ndqy1s=; b=RM3v8mic3sy4YVxKL4XU69U4BtTCm96g5UqeQXJBGsaaro2zRvLRHgHddD9MqQyFg9 OYXj/6W9fJZl9//m/gOy+ncS79KLlfjN6r71vGLMNUa7KAlOUuZ9rVz9shkoKSCS0n5h zZSSNAAb5XeT/EfszzyocZSKDCdbRJBhiNxENh2KOmoxBCoYHGWR+TGNN0aFuFJU9SQR SVZLBgqw0O1rmHjVJyGV+Pw06aPpZjbeZNuXOh5wozP+cyXsr5c+ofRPOJF2Tx3WxHJY zn5G+9hgQnHeELSkyBjznGdd5qM912T8NvbWkNi/KmAXmtGfnBqmYXLpdPz6hsTcofz1 7NgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=LIPMwnWW; 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 bg1-v6si1777381plb.695.2018.04.09.02.53.00; Mon, 09 Apr 2018 02:53:37 -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=LIPMwnWW; 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 S1752464AbeDIJrS (ORCPT + 99 others); Mon, 9 Apr 2018 05:47:18 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46014 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbeDIJrQ (ORCPT ); Mon, 9 Apr 2018 05:47:16 -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=VMFDYTUk+pxvY0RuMw5ZPsyYLaVZMd4pJKh+9ndqy1s=; b=LIPMwnWWbtmrksvO/shs2pLqR GyAZhjff/tspm8Nhdo5k0rkze6J89KpMZzs4cUCrOAZTPaEemgg7tGyppFWkJd9Sx9aGpRtVLfUjw HOjyC4Ov4XDbNT4qdebS60QYlHs4MVyDOq8dvtUl0zbZjzIb+tAWCWQ07YLxFqW3NYpEbKpX3SzYv /MJCrto9sSuOFfvKQO0kIf03J+0wQmZUjf5iahrvyHRWwxk/FjOmN5jOPTMdH4+1P6aROdWSFC0Mh +YiebiXxpFfR/WVZnFXCTTtFXdAzpeUi9xYL+MF2CqyzIMvVUr302JWnrc2SpDO9VhbqdkXgXvJl3 tnXzhSXVQ==; 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.90_1 #2 (Red Hat Linux)) id 1f5TOK-0006yy-K0; Mon, 09 Apr 2018 09:47:12 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EF5EC202A4A09; Mon, 9 Apr 2018 11:47:10 +0200 (CEST) Date: Mon, 9 Apr 2018 11:47:10 +0200 From: Peter Zijlstra To: Dietmar Eggemann Cc: linux-kernel@vger.kernel.org, Quentin Perret , Thara Gopinath , linux-pm@vger.kernel.org, Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , "Rafael J . Wysocki" , Greg Kroah-Hartman , Vincent Guittot , Viresh Kumar , Todd Kjos , Joel Fernandes Subject: Re: [RFC PATCH 3/6] sched: Add over-utilization/tipping point indicator Message-ID: <20180409094710.GJ4129@hirez.programming.kicks-ass.net> References: <20180320094312.24081-1-dietmar.eggemann@arm.com> <20180320094312.24081-4-dietmar.eggemann@arm.com> <20180409094001.GZ4043@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180409094001.GZ4043@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 09, 2018 at 11:40:01AM +0200, Peter Zijlstra wrote: > > (I know there is a new version out; but I was reading through this to > catch up with the discussion) > > On Tue, Mar 20, 2018 at 09:43:09AM +0000, Dietmar Eggemann wrote: > > +static inline int sd_overutilized(struct sched_domain *sd) > > +{ > > + return READ_ONCE(sd->shared->overutilized); > > +} > > + > > +static inline void update_overutilized_status(struct rq *rq) > > +{ > > + struct sched_domain *sd; > > + > > + rcu_read_lock(); > > + sd = rcu_dereference(rq->sd); > > + if (sd && !sd_overutilized(sd) && cpu_overutilized(rq->cpu)) > > + WRITE_ONCE(sd->shared->overutilized, 1); > > + rcu_read_unlock(); > > +} > > +#else > > I think you ought to go have a look at the end of > kernel/sched/topology.c:sd_init(), where it says: > > /* > * For all levels sharing cache; connect a sched_domain_shared > * instance. > */ > if (sd->flags & SD_SHARE_PKG_RESOURCES) { > sd->shared = *per_cpu_ptr(sdd->sds, sd_id); > atomic_inc(&sd->shared->ref); > atomic_set(&sd->shared->nr_busy_cpus, sd_weight); > } > > Because if I read all this correctly, your code assumes sd->shared > exists unconditionally, while the quoted bit only ensures it does so <= > LLC. Argh, n/m, I should read the whole patch before commenting I suppose ;-)