28 May, 2015

5 commits


27 Apr, 2015

1 commit

  • Pull more power management and ACPI updates from Rafael Wysocki:
    "These are fixes mostly (intel_pstate, ACPI core, ACPI EC driver,
    cpupower tool), a new CPU ID for the Intel RAPL driver and one
    intel_pstate driver improvement that didn't make it to my previous
    pull requests due to timing.

    Specifics:

    - Fix a build warning in the intel_pstate driver showing up in
    non-SMP builds (Borislav Petkov)

    - Change one of the intel_pstate's P-state selection parameters for
    Baytrail and Cherrytrail CPUs to significantly improve performance
    at the cost of a small increase in energy consumption (Kristen
    Carlson Accardi)

    - Fix a NULL pointer dereference in the ACPI EC driver due to an
    unsafe list walk in the query handler removal routine (Chris
    Bainbridge)

    - Get rid of a false-positive lockdep warning in the ACPI container
    hot-remove code (Rafael J Wysocki)

    - Prevent the ACPI device enumeration code from creating device
    objects of a wrong type in some cases (Rafael J Wysocki)

    - Add Skylake processors support to the Intel RAPL power capping
    driver (Brian Bian)

    - Drop the stale MAINTAINERS entry for the ACPI dock driver that is
    regarded as part of the ACPI core and maintained along with it now
    (Chao Yu)

    - Fix cpupower tool breakage caused by a library API change in libpci
    3.3.0 (Lucas Stach)"

    * tag 'pm+acpi-4.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI / scan: Add a scan handler for PRP0001
    ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline()
    ACPI / EC: fix NULL pointer dereference in acpi_ec_remove_query_handler()
    MAINTAINERS: remove maintainship entry of docking station driver
    powercap / RAPL: Add support for Intel Skylake processors
    cpufreq: intel_pstate: Fix an annoying !CONFIG_SMP warning
    intel_pstate: Change the setpoint for Atom params
    cpupower: fix breakage from libpci API change

    Linus Torvalds
     

20 Apr, 2015

2 commits

  • Pull turbostat update from Len Brown:
    "Updates to the turbostat utility.

    Just one kernel dependency in this batch -- added a #define to
    msr-index.h"

    * 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
    tools/power turbostat: correct dumped pkg-cstate-limit value
    tools/power turbostat: calculate TSC frequency from CPUID(0x15) on SKL
    tools/power turbostat: correct DRAM RAPL units on recent Xeon processors
    tools/power turbostat: Initial Skylake support
    tools/power turbostat: Use $(CURDIR) instead of $(PWD) and add support for O= option in Makefile
    tools/power turbostat: modprobe msr, if needed
    tools/power turbostat: dump MSR_TURBO_RATIO_LIMIT2
    tools/power turbostat: use new MSR_TURBO_RATIO_LIMIT names
    x86 msr-index: define MSR_TURBO_RATIO_LIMIT,1,2
    tools/power turbostat: label base frequency
    tools/power turbostat: update PERF_LIMIT_REASONS decoding
    tools/power turbostat: simplify default output

    Linus Torvalds
     
  • * pm-cpufreq:
    cpufreq: intel_pstate: Fix an annoying !CONFIG_SMP warning
    intel_pstate: Change the setpoint for Atom params

    * powercap:
    powercap / RAPL: Add support for Intel Skylake processors

    * pm-tools:
    cpupower: fix breakage from libpci API change

    Rafael J. Wysocki
     

19 Apr, 2015

8 commits


16 Apr, 2015

1 commit

  • libpci 3.3.0 introduced an additional member in the pci_filter struct
    which needs to be initialized to -1 to get the same behavior as before
    the API change. The libpci internal helpers got updated accordingly,
    but as the cpupower pci helpers initialized the struct themselves the
    behavior changed.

    Use the libpci helper pci_filter_init() to fix this and guard against
    similar breakages in the future.

    This fixes probing of the AMD fam12h/14h cpuidle monitor on systems
    with libpci >= 3.3.0.

    Signed-off-by: Lucas Stach
    Acked-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Lucas Stach
     

14 Apr, 2015

5 commits

  • ACPICA commit 84f3569db7accc576ace2dae81d101467254fe9d

    Was using %d instead of properly using %u.

    This patch only affects acpidump tool.

    Link: https://github.com/acpica/acpica/commit/84f3569d
    Signed-off-by: Bob Moore
    Signed-off-by: Lv Zheng
    Signed-off-by: Rafael J. Wysocki

    Bob Moore
     
  • ACPICA commit 9e2d8180f4d5e61949b17513bae8aff6412f62dd

    The offset calculation needn't convert a pointer to a special integer type.
    So this patch uses ACPI_TO_INTEGER() instead.

    This patch only affects acpidump tool.

    Link: https://github.com/acpica/acpica/commit/9e2d8180
    Signed-off-by: Lv Zheng
    Signed-off-by: Bob Moore
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     
  • syntax only.

    The cool kids are now using the phrase "base frequency",
    where in the past we used "max non-turbo frequency" or "TSC frequency".

    This distinction becomes important when a processor has a TSC
    that runs at a different speed than the "base frequency".

    Signed-off-by: Len Brown

    Len Brown
     
  • cosmetic only.

    order the decoding of MSR_PERF_LIMIT_REASONS bits
    from MSB to LSB -- which you notice when more than 1 bit is set
    and you are, say, comparing the output to the documentation...

    Signed-off-by: Len Brown

    Len Brown
     
  • Casual turbostat users generally just want to know MHz.
    So by default, just print enough information to make sense of MHz.

    All the other configuration data and columns for C-states and temperature etc,
    are printed with the --debug option.

    Signed-off-by: Len Brown

    Len Brown
     

12 Mar, 2015

1 commit

  • This reverts commit 5c1de006e8e66b0be05be422416629e344c71652.

    While the original commit makes it easier to run cpupower from the
    local build directory, it also leaves the binary with a rather poor
    rpath of './' in it after it is installed on a system via 'make install'.

    This is considered bad practice and can cause cpupower to fail in
    rpmbuild with the following error:

    ERROR 0004: file '/usr/bin/cpupower' contains an insecure rpath './' in [./]
    error: Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)
    Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)

    Developers should be able to use LD_LIBRARY_PATH to achieve the same
    effect and not introduce rpath into the binary.

    Signed-off-by: Josh Boyer
    Signed-off-by: Rafael J. Wysocki

    Josh Boyer
     

14 Feb, 2015

1 commit

  • * pm-cpufreq:
    cpufreq: speedstep-smi: enable interrupts when waiting

    * pm-cpuidle:
    intel_idle: support additional Broadwell model

    * pm-devfreq:
    PM / devfreq: event: testing the wrong variable

    * pm-opp:
    PM / OPP / clk: Remove unnecessary OOM message

    * pm-tools:
    tools/power turbostat: support additional Broadwell model
    tools/power turbostat: update parameters, documentation
    tools/power turbostat: Skip printing disabled package C-states

    Rafael J. Wysocki
     

12 Feb, 2015

1 commit


11 Feb, 2015

1 commit


10 Feb, 2015

8 commits

  • * pm-tools:
    tools/power turbostat: relax dependency on APERF_MSR
    tools/power turbostat: relax dependency on invariant TSC
    tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS
    tools/power turbostat: relax dependency on root permission
    cpupower Makefile change to help run the tool without 'make install'

    Rafael J. Wysocki
     
  • Long format options added, though the short ones should still work.
    eg. the new "--Counter 0x10" is the same as the old "-C 0x10"

    Note this Incompatibility:
    Old:
    -v displayed verbose debug output

    New:
    -v and --version simpaly display version

    Additional parameters:
    -d and --debug display verbose debug output
    -h and --help display a help message

    Updated turbosat.8 man page accordingly.

    Signed-off-by: Len Brown

    Len Brown
     
  • Replaced previously open-coded Package C-state Limit decoding
    with table-driven decoding. In doing so, updated to match January 2015
    "Intel(R) 64 and IA-23 Architectures Software Developer's Manual".

    In the past, turbostat would print package C-state residency columns
    for all package states supported by the model's architecture, even though
    a particular SKU may not support them, or they may be disabled by the BIOS.
    Now turbostat will skip printing colunns if MSRs indicate that they are not enabled.
    eg. many SKUs don't support PC7, and so that column will no longer be printed.

    Signed-off-by: Len Brown

    Len Brown
     
  • Pull turbostate changes for v3.20 from Len Brown.

    * 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux:
    tools/power turbostat: relax dependency on APERF_MSR
    tools/power turbostat: relax dependency on invariant TSC
    tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS
    tools/power turbostat: relax dependency on root permission

    Rafael J. Wysocki
     
  • While turbostat is significantly less useful on systems
    with no APERF_MSR, it seems more friendly
    to run on such systems and report what we can,
    rather than refusing to run.

    Update man page to reflect recent changes.

    Signed-off-by: Len Brown

    Len Brown
     
  • Turbostat can be useful on systems that do not support invariant TSC,
    so allow it to run on those systgems.

    All arithmetic in turbostat using the TSC value is per-processsor,
    so it does not depend on the TSC values being in sync acrosss processors.

    Turbostat uses gettimeofday() for the measurement interval
    rather than using the TSC directly, so that key metric
    is also immune from variable TSC.

    Turbostat prints a TSC sanity check column:

    TSC_MHz = TSC_delta/interval

    If this column is constant and is close to the processor
    base frequency, then the TSC is behaving properly.

    The other key turbostat columns are calculated this way:

    Avg_Mhz = APERF_delta/interval

    %Busy = MPERF_delta/TSC_delta

    Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/interval

    Tested on Core2 and Core2-Xeon, and so this patch includes
    a few other changes to remove the assumption that target
    systems are Nehalem and newer.

    Signed-off-by: Len Brown

    Len Brown
     
  • The Processor generation code-named Haswell
    added MSR_{CORE | GFX | RING}_PERF_LIMIT_REASONS
    to explain when and how the processor limits frequency.

    turbostat -v
    will now decode these bits.

    Each MSR has an "Active" set of bits which describe
    current conditions, and a "Logged" set of bits,
    which describe what has happened since last cleared.

    Turbostat currently doesn't clear the log bits.

    Signed-off-by: Len Brown

    Len Brown
     
  • For turbostat to run as non-root, it needs to permissions:

    1. read access to /dev/cpu/*/msr
    via standard user/group/world file permissions

    2. CAP_SYS_RAWIO
    eg. # setcap cap_sys_rawio=ep turbostat

    Yes, running as root still works.

    Signed-off-by: Len Brown

    Len Brown
     

05 Feb, 2015

1 commit


30 Jan, 2015

1 commit


20 Dec, 2014

2 commits

  • sysfs_get_idlestate_count() returns an unsigned int. Returning -ENODEV
    is not the right thing to do here, and in any case is handled the same
    way as if there are no states found.

    Signed-off-by: Prarit Bhargava
    Acked-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Prarit Bhargava
     
  • Some operations, like frequency-set, need root privileges. However,
    the way that this is detected is not correct. The getuid() is called,
    while in fact geteuid() should be. This way we can allow
    distributions or users to set SETUID flags on the cpupower binary if
    they want to and let regular users change the cpu frequency governor.

    Signed-off-by: Michal Privoznik
    Acked-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Michal Privoznik
     

15 Dec, 2014

1 commit

  • This reverts commit 16b7c275c055cc36218404b5d147be7f76575087.

    My previous commit 16b7c275c055 ("tools: cpupower: fix return checks for
    sysfs_get_idlestate_count()") was not correct. After looking
    at the changelog for cpupower I noticed that Thomas had changed the return of
    sysfs_get_idlestate_count() to an unsigned int to simplify the code. The
    problem is really that both he (in his original change) and I (in my new
    change) missed the obvious that sysfs_get_idlestate_count()
    can't return -ENODEV. It should just return 0 for "no c-states".

    Fixes: 16b7c275c055 (tools: cpupower: fix return checks for ...)
    Signed-off-by: Prarit Bhargava
    Signed-off-by: Rafael J. Wysocki

    Prarit Bhargava
     

05 Dec, 2014

1 commit

  • Red Hat and Fedora use a bug reporting tool that gathers data about
    "broken" systems called sosreport. Among other things, it includes the
    output of 'cpupower idle-info'. Executing 'cpupower idle-info' on a
    system that has cpuidle disabled via 'cpuidle.off=1' results in a 300
    second hang in the cpupower application.

    ie)
    [root@intel-brickland-05]# cpupower idle-info
    Could not determine cpuidle driver

    Analyzing CPU 0:
    Number of idle states: -19
    [hang]

    The problem is that the cpupower code only checks for a zero return from
    sysfs_get_idlestate_count(). The function can return -ENODEV (-19) as
    above. This patch fixes callers to sysfs_get_idlestate_count() to check
    the right return values.

    Signed-off-by: Prarit Bhargava
    Signed-off-by: Thomas Renninger
    Signed-off-by: Rafael J. Wysocki

    Prarit Bhargava