[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180216174355.GK25201@hirez.programming.kicks-ass.net>
Date: Fri, 16 Feb 2018 18:43:55 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Quentin Perret <quentin.perret@....com>
Cc: Morten Rasmussen <morten.rasmussen@...s.arm.com>,
Morten Rasmussen <morten.rasmussen@....com>, mingo@...hat.com,
valentin.schneider@....com, dietmar.eggemann@....com,
vincent.guittot@...aro.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity
optimizations
On Fri, Feb 16, 2018 at 05:39:27PM +0000, Quentin Perret wrote:
> AFAIU it should be safe, but without your check you'll have to go through
> cpus_read_lock()/unlock() every time a CPU is hotplugged. There is probably
> no good reason to re-do that again and again if the state of the key
> never changes. I don't know how expensive those lock/unlock operations are,
> but I bet they are more expensive than testing static_branch_unlikely() :)
This is not a performance critical path, more obvious code is more
better.
Also cpus_read_lock() is dirt cheap most of the time.
Powered by blists - more mailing lists