lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070409194142.88f0a5e5.akpm@linux-foundation.org>
Date:	Mon, 9 Apr 2007 19:41:42 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Dave Jones <davej@...hat.com>
Cc:	"Jeff V. Merkey" <jmerkey@...fmountaingroup.com>,
	Linux kernel <linux-kernel@...r.kernel.org>,
	Venki Pallipadi <venkatesh.pallipadi@...el.com>
Subject: Re: Preemption Broken:  centrino_target busted under SMP on
 2.6.20.4

On Mon, 9 Apr 2007 22:31:08 -0400 Dave Jones <davej@...hat.com> wrote:

> On Mon, Apr 09, 2007 at 05:26:51PM -0700, Andrew Morton wrote:
>  > On Thu, 5 Apr 2007 16:50:34 -0400
>  > Dave Jones <davej@...hat.com> wrote:
>  > 
>  > > diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
>  > > index f43b987..824d0a2 100644
>  > > --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
>  > > +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
>  > > @@ -708,6 +708,7 @@ static int centrino_target (struct cpufreq_policy *policy,
>  > >  	saved_mask = current->cpus_allowed;
>  > >  	first_cpu = 1;
>  > >  	cpus_clear(covered_cpus);
>  > > +	preempt_disable();
>  > >  	for_each_cpu_mask(j, online_policy_cpus) {
>  > >  		/*
>  > >  		 * Support for SMP systems.
>  > > @@ -798,6 +799,7 @@ static int centrino_target (struct cpufreq_policy *policy,
>  > >  	}
>  > >  
>  > >  migrate_end:
>  > > +	preempt_enable();
>  > >  	set_cpus_allowed(current, saved_mask);
>  > >  	return 0;
>  > >  }
>  > 
>  > This means we'll call set_cpus_allowed() while in atomic state, but
>  > set_cpus_allowed() does sleepy stuff.
> 
> Puzzled. This diff shouldn't change anything about the context we're in
> when we call set_cpus_allowed, and as we're not seeing warnings now,
> I'm not sure what I'm missing?

set_cpus_allowed() will only sleep in special circumstances: when we're
telling the target task that it is not allwed to run on a CPU upon which it
is presently executing.  So it needs to be synchronously migrated off that
CPU, which requires that the set_cpus_allowed() caller block.

You're probably just not hitting that case.

Probably we should have a might_sleep() in set_cpus_allowed(), although
there might be callers who are guaranteeed to never hit that case and who
might legitimately want special treatment to avoid the warning.

> [which may be 'the obvious', you wouldn't believe the evening I've had
>  involving gas leaks and noxious fumes. Wheee, floaty head.]

Yeah, I get a lot of patches like that.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ