[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100331063546.GB28659@aftab>
Date: Wed, 31 Mar 2010 08:35:47 +0200
From: Borislav Petkov <bp@...64.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: davej@...hat.com, trenn@...e.de, linux@...inikbrodowski.net,
mingo@...e.hu, hpa@...or.com, tglx@...utronix.de,
cpufreq@...r.kernel.org, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [-v2 PATCH 2/6] powernow-k8: Add core performance boost support
From: Andrew Morton <akpm@...ux-foundation.org>
Date: Tue, Mar 30, 2010 at 11:22:21PM -0400
> On Wed, 31 Mar 2010 08:13:43 +0200 Borislav Petkov <bp@...64.org> wrote:
>
> > > > +static void _cpb_toggle_msrs(bool t)
> > > > +{
> > > > + int cpu;
> > > > +
> > > > + rdmsr_on_cpus(cpu_online_mask, MSR_K7_HWCR, msrs);
> > > > +
> > > > + for_each_cpu(cpu, cpu_online_mask) {
> > > > + struct msr *reg = per_cpu_ptr(msrs, cpu);
> > > > + if (t)
> > > > + reg->l &= ~BIT(25);
> > > > + else
> > > > + reg->l |= BIT(25);
> > > > + }
> > > > + wrmsr_on_cpus(cpu_online_mask, MSR_K7_HWCR, msrs);
> > > > +}
> > >
> > > What prevents cpu_online_mask from changing while this is happening?
> >
> > Frankly, nothing.
>
> Sneak a get_online_cpus()/put_online_cpus() in there?
Yep, that'll make it safe wrt to accessing the mask. I'll also have to
check whether there are some cores missing before toggling the bit and
warn accordingly. Do you want a relative diff ontop of this patch or
should I redo the original one?
Thanks.
--
Regards/Gruss,
Boris.
--
Advanced Micro Devices, Inc.
Operating Systems Research Center
--
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