All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dave Jones <davej@redhat.com>
Cc: "Jeff V. Merkey" <jmerkey@wolfmountaingroup.com>,
	Linux kernel <linux-kernel@vger.kernel.org>,
	Venki Pallipadi <venkatesh.pallipadi@intel.com>
Subject: Re: Preemption Broken:  centrino_target busted under SMP on 2.6.20.4
Date: Mon, 9 Apr 2007 20:51:36 -0700	[thread overview]
Message-ID: <20070409205136.75709d3e.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070410030823.GA16229@redhat.com>

On Mon, 9 Apr 2007 23:08:23 -0400 Dave Jones <davej@redhat.com> wrote:

>  > This whole file is going away in .22, and we have a viable alternative in
>  > .21 (acpi-cpufreq), so I'm not overly worried about fixing this up
>  > given it only shows up in debug kernels, especially at this stage in -rc.
>  > 
>  > (Yeah, it's a cop-out, but unless someone with more interest in this problem
>  >  steps up, I've bigger fishes to fry).
> 
> One last try...
> (I didn't think too long about this, so this might be equally busted,
>  but if so, see comment above).
> 
> 	Dave
> 
> diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
> index f43b987..38e31ce 100644
> --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
> +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
> @@ -720,11 +720,13 @@ static int centrino_target (struct cpufreq_policy *policy,
>  			cpu_set(j, set_mask);
>  
>  		set_cpus_allowed(current, set_mask);
> +		preempt_disable();
>  		if (unlikely(!cpu_isset(smp_processor_id(), set_mask))) {
>  			dprintk("couldn't limit to CPUs in this domain\n");
>  			retval = -EAGAIN;
>  			if (first_cpu) {
>  				/* We haven't started the transition yet. */
> +				preempt_enable();
>  				goto migrate_end;
>  			}
>  			break;
> @@ -765,6 +767,7 @@ static int centrino_target (struct cpufreq_policy *policy,
>  			break;
>  
>  		cpu_set(j, covered_cpus);
> +		preempt_enable();
>  	}
>  

Yes, I expect that should squish the warnings.  It looks all racy wrt cpu hotplug
and against async set_cpus_allowed(), but if those are our worst problems, we're
good.

  reply	other threads:[~2007-04-10  3:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-05 20:33 Preemption Broken: centrino_target busted under SMP on 2.6.20.4 Jeff V. Merkey
2007-04-05 20:50 ` Dave Jones
2007-04-10  0:26   ` Andrew Morton
2007-04-10  2:31     ` Dave Jones
2007-04-10  2:41       ` Andrew Morton
2007-04-10  3:05         ` Dave Jones
2007-04-10  3:08           ` Dave Jones
2007-04-10  3:51             ` Andrew Morton [this message]
2007-04-10  4:29               ` Dave Jones

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=20070409205136.75709d3e.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=jmerkey@wolfmountaingroup.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=venkatesh.pallipadi@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.