From: Borislav Petkov <bp@amd64.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: davej@redhat.com, trenn@suse.de, linux@dominikbrodowski.net,
mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de,
cpufreq@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [-v2 PATCH 2/6] powernow-k8: Add core performance boost support
Date: Wed, 31 Mar 2010 08:13:43 +0200 [thread overview]
Message-ID: <20100331061343.GA28659@aftab> (raw)
In-Reply-To: <20100330154229.dc8ebd24.akpm@linux-foundation.org>
From: Andrew Morton <akpm@linux-foundation.org>
Date: Tue, Mar 30, 2010 at 03:42:29PM -0700
Hi Andrew,
> On Fri, 26 Mar 2010 14:39:56 +0100
> Borislav Petkov <bp@amd64.org> wrote:
>
> > From: Borislav Petkov <borislav.petkov@amd.com>
> >
> > Starting with F10h, revE, AMD processors add support for a dynamic
> > core boosting feature called Core Performance Boost. When a specific
> > condition is present, a subset of the cores on a system are boosted
> > beyond their P0 operating frequency to speed up the performance of
> > single-threaded applications.
> >
> > In the normal case, the system comes out of reset with core boosting
> > enabled. This patch adds a sysfs knob with which core boosting can be
> > switched on or off for benchmarking purposes.
> >
> > While at it, cleanup the driver init codepath and update copyrights.
> >
> > ...
> >
> > +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. And yes, we talked a lot about this internally, since,
you need this bit cleared on _all_ cores for the processor to boost.
Now, if you've offlined some of the cores, you won't be able to execute
any code on them and thus clear this bit.
However, this interface is there only for benchmarking purposes and
stuff, i.e. normally, you shouldn't need to touch it _at_ _all_ and
boosting will work out of the box and without user interaction.
So, IMHO, hotplug notifiers won't work since you need all cores online
at that particular moment to enable boosting. It sounds more reasonable
to me to WARN when a core is missing from the mask that boosting cannot
be enabled. I'll cook up something later today.
Thanks.
--
Regards/Gruss,
Boris.
--
Advanced Micro Devices, Inc.
Operating Systems Research Center
next prev parent reply other threads:[~2010-03-31 6:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-26 13:39 [-v2 PATCH 0/6] powernow-k8: Core Performance Boost and effective frequency support Borislav Petkov
2010-03-26 13:39 ` [-v2 PATCH 1/6] x86, cpu: Add AMD core boosting feature flag to /proc/cpuinfo Borislav Petkov
2010-03-26 13:39 ` [-v2 PATCH 2/6] powernow-k8: Add core performance boost support Borislav Petkov
2010-03-30 22:42 ` Andrew Morton
2010-03-31 6:13 ` Borislav Petkov [this message]
2010-03-31 3:22 ` Andrew Morton
2010-03-31 6:35 ` Borislav Petkov
2010-03-31 3:38 ` Andrew Morton
2010-03-31 6:42 ` H. Peter Anvin
2010-03-31 15:08 ` Borislav Petkov
2010-03-31 15:16 ` Dave Jones
2010-04-09 20:57 ` H. Peter Anvin
2010-04-09 20:59 ` H. Peter Anvin
2010-04-08 9:48 ` Borislav Petkov
2010-03-26 13:39 ` [-v2 PATCH 3/6] x86: Unify APERF/MPERF support Borislav Petkov
2010-03-26 13:39 ` [-v2 PATCH 4/6] cpufreq: Add APERF/MPERF support for AMD processors Borislav Petkov
2010-03-26 13:39 ` [-v2 PATCH 5/6] powernow-k8: Fix frequency reporting Borislav Petkov
2010-03-26 13:40 ` [-v2 PATCH 6/6] cpufreq: Unify sysfs attribute definition macros Borislav Petkov
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=20100331061343.GA28659@aftab \
--to=bp@amd64.org \
--cc=akpm@linux-foundation.org \
--cc=cpufreq@vger.kernel.org \
--cc=davej@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=trenn@suse.de \
--cc=x86@kernel.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