Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1440435

Re: [PATCH v2 06/13] sched: Store maximum per-cpu capacity in root domain

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 06/13] sched: Store maximum per-cpu capacity in root domain
Date 2016-07-11 12:20 +0200
Message-ID <rTGtH-5FU-7@gated-at.bofh.it> (permalink)
References <rMTP3-6im-5@gated-at.bofh.it> <rMTP3-6im-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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:

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 06/13] sched: Store maximum per-cpu capacity in root  domain Peter Zijlstra <peterz@infradead.org> - 2016-07-11 12:20 +0200
  Re: [PATCH v2 06/13] sched: Store maximum per-cpu capacity in root  domain Dietmar Eggemann <dietmar.eggemann@arm.com> - 2016-07-11 18:20 +0200
    Re: [PATCH v2 06/13] sched: Store maximum per-cpu capacity in root  domain Peter Zijlstra <peterz@infradead.org> - 2016-07-12 13:50 +0200
      Re: [PATCH v2 06/13] sched: Store maximum per-cpu capacity in root  domain Dietmar Eggemann <dietmar.eggemann@arm.com> - 2016-07-13 13:30 +0200

csiph-web