Re: [patch 0/6] AMD C1E aware idle support



On Thursday, 12 of June 2008, Thomas Gleixner wrote:
AMD CPUs with C1E support are currently excluded from high resolution
timers and NOHZ support. The reason is that C1E is a BIOS controlled
C3 power state which switches off TSC and the local APIC timer. The
ACPI C-State control manages the TSC/local APIC timer wreckage, but
this does not include the C1 based ("halt" instruction) C1E mode. The
BIOS/SMM controlled C1E state works on most systems even without
enabling ACPI C-State control.

The fact that a system has C1E support enabled is advertised in a MSR,
but the time during boot when the C1E bit is set by the BIOS varies:

1) Boot CPU has already C1E bit set
2) Secondary CPU sets C1E bit
3) C1E bit is set after ACPI C-State query

Case #1 and #2 are covered by the current implementation, but case #3
results in a complete system lockup due to missing timer
interrupts. The current solution is to disable the local APIC timer
and use the PIT in broadcast mode. This restricts the C1E enabled
systems to periodic timer mode.

The following patch series implements a C1E aware idle function which
also covers the late C1E enablement (case #3):

The function is selected during boot for CPUs which have possibly C1E
support. The function checks the MSR which contains the C1E active
bits before executing the halt instruction. When one of the C1E active
bits is set, it makes the system C1E aware by enabling the timer
broadcast mechanism for all CPUs. For high resolution timer and/or
nohz enabled systems it calls the oneshot timer broadcast mechanism
before executing the halt instruction. This is the same mechanism
which is used in the ACPI C-State control for C2/C3 power states.

On my C1E affected X2 box these patches reduce the wakeups/sec down to
20 according to powertop.

The patches work fine on systems which are not affected by the dreaded
ATI chipset timer wreckage. On those which have the problem, the box
needs help from the keyboard to continue working.

The x86 changes for .27 contain a complete overhaul of the affected
code, but this is out of scope for this patchset.

For those who are interested to test those patches on top of 2.6.26-rc
I extracted a patch and added it to the c1e series. It's available
from:

http://www.kernel.org/pub/linux/kernel/people/tglx/c1e/2.6.26-rc5-c1e-patches.tar.gz
or
http://www.kernel.org/pub/linux/kernel/people/tglx/c1e/2.6.26-rc5-c1e-patches.tar.bz2

I guess the x86-next-apic-timer-fixes.patch is a combination of all patches in
this series. Is that correct?

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [patch 0/6] AMD C1E aware idle support
    ... AMD CPUs with C1E support are currently excluded from high resolution ... C3 power state which switches off TSC and the local APIC timer. ... enabling ACPI C-State control. ... The function is selected during boot for CPUs which have possibly C1E ...
    (Linux-Kernel)
  • Re: One-shot high-resolution POSIX timer periodically late
    ... small bursts due to network jitter (typical average rate of 1000 packets ... Just before I re-send a packet, I arm a one-shot timer in order to ... Linux Plug and Play Support v0.97 Adam Belay ...
    (Linux-Kernel)
  • NForce2: 2.6.0-test11-bk6 UP high interrupt error count with lapic noapic
    ... It is necessary to have both the APIC timer and the 8254 timer running ... Can the 8254 timer be disabled if the APIC timer is running. ... ATAPI CD-ROM, with removable media ... Linux Plug and Play Support v0.97 Adam Belay ...
    (Linux-Kernel)
  • Re: ACPI PM Timer vs. C1 halt issue
    ... ACPI as such is included. ... hot again even with tsc timer. ... # ACPI Support ... # Old CD-ROM drivers ...
    (Linux-Kernel)
  • RE: Timer Control query
    ... Comparing the Timer Classes in the .NET Framework Class Library ... Microsoft Online Community Support ... initial response from the community or a Microsoft Support Engineer within ...
    (microsoft.public.dotnet.languages.vb)