All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: cpufreq@vger.kernel.org
Subject: [Bug 19702] i5-450M CPU gets stuck in low/lowest state
Date: Thu, 28 Oct 2010 15:12:18 GMT	[thread overview]
Message-ID: <201010281512.o9SFCIVa007628@demeter1.kernel.org> (raw)
In-Reply-To: <bug-19702-12968@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=19702





--- Comment #27 from Thomas Renninger <trenn@suse.de>  2010-10-28 15:12:08 ---
I expect acpi-cpufreq is fundamentally broken in respect to HW_ALL
coordination.
The only aspect acpi-cpufreq or cpufreq subsystem takes into account in HW_ALL
case is to make sure that the same governor is running on all dependent CPUs in
case CONFIG_HOTPLUG_CPU is set in .config.
Otherwise the dependent CPUs are only shown as "related" in sysfs, that's all.

The only thing which makes me wonder is: Why has this not come up earlier...

From ACPI spec it's impossible to guess how OS should deal with HW_ALL.
Googling about it leads to this bug :) and one interesting discussion:
http://www.mail-archive.com/linux-acpi@vger.kernel.org/msg11682.html
-> adding Len and Rui into CC.
But from there it's also not 100% clear.

While SW_ALL is very clear, I could imagine the difference between HW_ALL and
SW_ANY is that the (MSR/HW) status registers may/may not get updated. Or that
HW may or may not transition the other core(s) into the same state and SW has
to re-evaluate (what would be rather stupid and SW_ALL algorithm should apply
then).

Hmm, I found:
14.2 P-STATE HARDWARE COORDINATION
in
Intel® 64 and IA-32 Architectures Software Developer’s Manual
Volume 3A: System Programming Guide, Part 1

But the code in there is so poor.
Essentially it tells us to use aperf/mperf for switching decisions.
The part that aperf/mperf should get reset to 0, should vanish from this
document, it's possible to write an algorithm which can handle register
overflows, setting them back to zero is wrong.

And this comment there:
// This example does not cover the additional logic or algorithms
// necessary to coordinate multiple logical processors to a target P-state.
makes me wonder whether we also miss this additional logic in
acpi-cpufreq/ondemand.

The ondemand governor must know about the dependency and look at the
utilization of all dependent cores when doing decisions which is not the case.
I expect Heinz and Peter get "half way correct" switching at about 52
up_threshold because they have two "related" cores.
Vyncere you have 4 dependent cores, if your core(s) are switched up with an
up_threshold of 25 I expect you see the same bug.

My patches or say workaround may help for Heinz's BIOS, it may not for others.
Also this must get fixed properly. For this some input from Intel people would
be great how HW_ALL must get handled or better how it's done on Windows.

You could try to find out how your HW behave by not loading any cpufreq driver,
get the msr-tools package and set the frequency on single cores manually and
then read out status MSR whether the dependent cores switched as well (question
is whether the status is true then, may be CPU specific and may have nothing to
do how the OS must implement HW_ALL algorithm).
The MSRs are:
#define MSR_IA32_PERF_STATUS 0x00000198     
#define MSR_IA32_PERF_CTL    0x00000199
You have to be careful that only 16 bits (0-15, cmp. with chapter 14.3.2.2 in
above mentioned document) are used when you write to PERF_CTL, you have to read
out and keep the others and write them back as well.

Long story short (Provided my whole research for comments whether I have a
thinko):
HW_ALL is about taking aperf/mperf into account. We do not rely on BIOS, but
determine that already by reading out cpuid aperf/mperf capabilities of the CPU
directly. Still the governor must consider all dependent cores which is
currently not the case and which is a major bug.
Question still is whether all cores (like SW_ALL) or only one core (like
SW_ANY) is enough to switch. SW_ALL should work for sure -> will provide a
patch.

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

  parent reply	other threads:[~2010-10-28 15:12 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-19702-12968@https.bugzilla.kernel.org/>
2010-10-04  6:42 ` [Bug 19702] i5-450M CPU gets stuck in low/lowest state bugzilla-daemon
2010-10-04  6:43 ` bugzilla-daemon
2010-10-04  6:44 ` bugzilla-daemon
2010-10-08  5:26 ` bugzilla-daemon
2010-10-08 12:59 ` bugzilla-daemon
2010-10-08 19:04 ` bugzilla-daemon
2010-10-08 19:06 ` bugzilla-daemon
2010-10-12 11:19 ` bugzilla-daemon
2010-10-14  5:56 ` bugzilla-daemon
2010-10-14  5:58 ` bugzilla-daemon
2010-10-14  9:11 ` bugzilla-daemon
2010-10-14  9:22 ` bugzilla-daemon
2010-10-14 15:20 ` bugzilla-daemon
2010-10-15 10:07 ` bugzilla-daemon
2010-10-15 10:12 ` bugzilla-daemon
2010-10-15 10:15 ` bugzilla-daemon
2010-10-15 17:52 ` bugzilla-daemon
2010-10-15 19:25 ` bugzilla-daemon
2010-10-15 19:37 ` bugzilla-daemon
2010-10-16  8:56 ` bugzilla-daemon
2010-10-16  9:19 ` bugzilla-daemon
2010-10-19  2:50 ` bugzilla-daemon
2010-10-19  3:12 ` bugzilla-daemon
2010-10-19  3:51 ` bugzilla-daemon
2010-10-19  3:52 ` bugzilla-daemon
2010-10-19  7:34 ` bugzilla-daemon
2010-10-19  9:40 ` bugzilla-daemon
2010-10-19 14:13 ` bugzilla-daemon
2010-10-19 22:47 ` bugzilla-daemon
2010-10-28 15:12 ` bugzilla-daemon [this message]
2010-10-28 15:13 ` bugzilla-daemon
2010-10-29 11:06 ` bugzilla-daemon
2010-10-29 12:14 ` bugzilla-daemon
2010-10-29 13:00 ` bugzilla-daemon
2010-10-29 15:49 ` bugzilla-daemon
2010-10-29 20:15 ` bugzilla-daemon
2010-10-29 20:19 ` bugzilla-daemon
2010-11-01 10:49 ` bugzilla-daemon
2010-11-01 13:42 ` bugzilla-daemon
2010-11-01 17:43 ` bugzilla-daemon
2010-11-01 18:03 ` bugzilla-daemon
2010-11-01 18:16 ` bugzilla-daemon
2010-11-02  7:09 ` bugzilla-daemon
2010-11-02  8:59 ` bugzilla-daemon
2010-11-02  9:03 ` bugzilla-daemon
2010-11-03 20:42 ` bugzilla-daemon
2010-11-04  8:15 ` bugzilla-daemon
2010-11-04  8:41 ` bugzilla-daemon
2010-11-08 12:32 ` bugzilla-daemon
2010-11-08 12:49 ` bugzilla-daemon
2010-11-09 17:38 ` bugzilla-daemon
2010-11-10 11:18 ` bugzilla-daemon
2010-11-10 12:51 ` bugzilla-daemon
2011-07-31 17:58 ` bugzilla-daemon
2011-08-01  7:35 ` bugzilla-daemon
2011-08-11 13:00 ` bugzilla-daemon
2011-08-12 13:20 ` bugzilla-daemon
2011-08-15 15:04 ` bugzilla-daemon
2011-08-15 15:08 ` bugzilla-daemon
2012-06-18 19:11 ` bugzilla-daemon

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=201010281512.o9SFCIVa007628@demeter1.kernel.org \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=cpufreq@vger.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 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.