cpufreq Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: cpufreq@lists.linux.org.uk
Subject: Re: Race in cpufreq_add_dev()?
Date: Mon, 2 Oct 2006 20:27:38 -0400	[thread overview]
Message-ID: <20061003002738.GI9748@dominikbrodowski.de> (raw)
In-Reply-To: <44AD6609.1080604@goop.org>

On Thu, Jul 06, 2006 at 12:35:37PM -0700, Jeremy Fitzhardinge wrote:
> cpufreq_add_dev contains the test:
> 
> #ifdef CONFIG_SMP
> 	/* check whether a different CPU already registered this
> 	 * CPU because it is in the same boat. */
> 	policy = cpufreq_cpu_get(cpu);
> 	if (unlikely(policy)) {
> 		cpufreq_cpu_put(policy);
> 		cpufreq_debug_enable_ratelimit();
> 		return 0;
> 	}
> #endif
> 
> I don't see what prevents two CPUs from racing through here.  Both could 
> perform this test and find that there's no policy for the CPU, and then 
> both will attempt to add it.  Or is there something else which 
> serializes multiple CPUs through this code?

AFAICS it is protected by sysdev_drivers_lock.

	Dominik

      reply	other threads:[~2006-10-03  0:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06 19:35 Race in cpufreq_add_dev()? Jeremy Fitzhardinge
2006-10-03  0:27 ` Dominik Brodowski [this message]

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=20061003002738.GI9748@dominikbrodowski.de \
    --to=linux@dominikbrodowski.net \
    --cc=cpufreq@lists.linux.org.uk \
    --cc=jeremy@goop.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