From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758092AbcGKKSh (ORCPT ); Mon, 11 Jul 2016 06:18:37 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:36336 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752033AbcGKKSg (ORCPT ); Mon, 11 Jul 2016 06:18:36 -0400 Date: Mon, 11 Jul 2016 12:18:32 +0200 From: Peter Zijlstra To: Morten Rasmussen Cc: mingo@redhat.com, dietmar.eggemann@arm.com, yuyang.du@intel.com, vincent.guittot@linaro.org, mgalbraith@suse.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 06/13] sched: Store maximum per-cpu capacity in root domain Message-ID: <20160711101832.GN30909@twins.programming.kicks-ass.net> References: <1466615004-3503-1-git-send-email-morten.rasmussen@arm.com> <1466615004-3503-7-git-send-email-morten.rasmussen@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466615004-3503-7-git-send-email-morten.rasmussen@arm.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 22, 2016 at 06:03:17PM +0100, Morten Rasmussen wrote: > @@ -6905,11 +6906,19 @@ static int build_sched_domains(const struct cpumask *cpu_map, > /* Attach the domains */ > rcu_read_lock(); > for_each_cpu(i, cpu_map) { > + rq = cpu_rq(i); > sd = *per_cpu_ptr(d.sd, i); > cpu_attach_domain(sd, d.rd, i); > + > + if (rq->cpu_capacity_orig > rq->rd->max_cpu_capacity) > + rq->rd->max_cpu_capacity = rq->cpu_capacity_orig; > } Should you not set that _before_ cpu_attach_domain(), such that the state is up-to-date when its published? Also, since its lockless, should we not use {READ,WRITE}_ONCE() with it? > rcu_read_unlock(); > > + if (rq) > + pr_info("span: %*pbl (max cpu_capacity = %lu)\n", > + cpumask_pr_args(cpu_map), rq->rd->max_cpu_capacity); > + While a single statement, it is multi line, please add brackets. > ret = 0; > error: