public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Quentin Perret <qperret@google.com>
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	peterz@infradead.org, vincent.guittot@linaro.org,
	Dietmar.Eggemann@arm.com, morten.rasmussen@arm.com,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] sched/topology: Allow sched_asym_cpucapacity to be disabled
Date: Tue, 15 Oct 2019 12:56:32 +0100	[thread overview]
Message-ID: <20191015115632.GC242992@google.com> (raw)
In-Reply-To: <d1dac9d1-3ac6-1a1b-f1c9-48b136833686@arm.com>

On Tuesday 15 Oct 2019 at 12:49:22 (+0100), Valentin Schneider wrote:
> 
> 
> On 15/10/2019 11:58, Valentin Schneider wrote:
> > On 15/10/2019 11:40, Quentin Perret wrote:
> >>> @@ -2124,8 +2124,17 @@ static void detach_destroy_domains(const struct cpumask *cpu_map)
> >>>  	int i;
> >>>  
> >>>  	rcu_read_lock();
> >>> +
> >>> +	if (static_key_enabled(&sched_asym_cpucapacity)) {
> >>> +		unsigned int cpu = cpumask_any(cpu_map);
> >>> +
> >>> +		if (rcu_dereference(per_cpu(sd_asym_cpucapacity, cpu)))
> >>> +			static_branch_dec_cpuslocked(&sched_asym_cpucapacity);
> >>
> >> Lockdep should scream for this :)
> > 
> > Bleh, yes indeed...
> > 
> 
> Urgh, I forgot about the funny hotplug lock scenario at boot time.
> rebuild_sched_domains() takes the lock but sched_init_domains() doesn't, so
> we don't get the might_sleep warn at boot time.
> 
> So if we want to flip the key post boot time we probably need to separately
> count our asymmetric root domains and flip the key after all the rebuilds,
> outside of the hotplug lock.

Hmm, a problem here is that static_branch*() can block (it uses a
mutex) while you're in the rcu section, I think.

I suppose you could just move this above rcu_read_lock() and use
rcu_access_pointer() instead ?

Thanks,
Quentin

  reply	other threads:[~2019-10-15 11:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 10:29 [PATCH v2] sched/topology: Allow sched_asym_cpucapacity to be disabled Valentin Schneider
2019-10-15 10:40 ` Quentin Perret
2019-10-15 10:58   ` Valentin Schneider
2019-10-15 11:49     ` Valentin Schneider
2019-10-15 11:56       ` Quentin Perret [this message]
2019-10-15 12:57         ` Valentin Schneider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191015115632.GC242992@google.com \
    --to=qperret@google.com \
    --cc=Dietmar.Eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox