#!/bin/bash # # NAME # failcmd.sh - run a command with injecting slab/page allocation failures # # SYNOPSIS # failcmd.sh --help # failcmd.sh [] command [arguments] # # DESCRIPTION # Run command with injecting slab/page allocation failures by fault # injection. # # NOTE: you need to run this script as root. # usage() { cat >&2 <&2 exit 1 fi DEBUGFS=`mount -t debugfs | head -1 | awk '{ print $3}'` if [ ! -d "$DEBUGFS" ]; then echo debugfs is not mounted >&2 exit 1 fi FAILCMD_TYPE=${FAILCMD_TYPE:-failslab} FAULTATTR=$DEBUGFS/$FAILCMD_TYPE if [ ! -d $FAULTATTR ]; then echo $FAILCMD_TYPE is not available >&2 exit 1 fi LONGOPTS=probability:,interval:,times:,space:,verbose:,task-filter: LONGOPTS=$LONGOPTS,stacktrace-depth:,require-start:,require-end: LONGOPTS=$LONGOPTS,reject-start:,reject-end:,oom-kill-allocating-task:,help if [ $FAILCMD_TYPE = failslab ]; then LONGOPTS=$LONGOPTS,ignore-gfp-wait:,cache-filter: elif [ $FAILCMD_TYPE = fail_page_alloc ]; then LONGOPTS=$LONGOPTS,ignore-gfp-wait:,ignore-gfp-highmem:,min-order: fi TEMP=`getopt -o p:i:t:s:v:h --long $LONGOPTS -n 'failcmd.sh' -- "$@"` if [ $? != 0 ]; then usage exit 1 fi eval set -- "$TEMP" fault_attr_default() { echo N > $FAULTATTR/task-filter echo 0 > $FAULTATTR/probability echo 1 > $FAULTATTR/times } fault_attr_default oom_kill_allocating_task_saved=`cat /proc/sys/vm/oom_kill_allocating_task` restore_values() { fault_attr_default echo $oom_kill_allocating_task_saved \ > /proc/sys/vm/oom_kill_allocating_task } # # Default options # declare -i oom_kill_allocating_task=1 declare task_filter=Y declare -i probability=1 declare -i times=1 while true; do case "$1" in -p|--probability) probability=$2 shift 2 ;; -i|--interval) echo $2 > $FAULTATTR/interval shift 2 ;; -t|--times) times=$2 shift 2 ;; -s|--space) echo $2 > $FAULTATTR/space shift 2 ;; -v|--verbose) echo $2 > $FAULTATTR/verbose shift 2 ;; --task-filter) task_filter=$2 shift 2 ;; --stacktrace-depth) echo $2 > $FAULTATTR/stacktrace-depth shift 2 ;; --require-start) echo $2 > $FAULTATTR/require-start shift 2 ;; --require-end) echo $2 > $FAULTATTR/require-end shift 2 ;; --reject-start) echo $2 > $FAULTATTR/reject-start shift 2 ;; --reject-end) echo $2 > $FAULTATTR/reject-end shift 2 ;; --oom-kill-allocating-task) oom_kill_allocating_task=$2 shift 2 ;; --ignore-gfp-wait) echo $2 > $FAULTATTR/ignore-gfp-wait shift 2 ;; --cache-filter) echo $2 > $FAULTATTR/cache_filter shift 2 ;; --ignore-gfp-highmem) echo $2 > $FAULTATTR/ignore-gfp-highmem shift 2 ;; --min-order) echo $2 > $FAULTATTR/min-order shift 2 ;; -h|--help) usage exit 0 shift ;; --) shift break ;; esac done [ -z "$1" ] && exit 0 echo $oom_kill_allocating_task > /proc/sys/vm/oom_kill_allocating_task echo $task_filter > $FAULTATTR/task-filter echo $probability > $FAULTATTR/probability echo $times > $FAULTATTR/times trap "restore_values" SIGINT SIGTERM EXIT cmd="echo 1 > /proc/self/make-it-fail && exec $@" bash -c "$cmd" >space:mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2017-02-03 14:18:39 -0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-02-04 00:11:08 +0100
commit6e978b22efa1db9f6e71b24440b5f1d93e968ee3 (patch)
treec666f7a26b860674848949e39a610222b0723f89 /net/sched/em_canid.c
parent3c223c19aea85d3dda1416c187915f4a30b04b1f (diff)
cpufreq: intel_pstate: Disable energy efficiency optimization
Some Kabylake desktop processors may not reach max turbo when running in HWP mode, even if running under sustained 100% utilization. This occurs when the HWP.EPP (Energy Performance Preference) is set to "balance_power" (0x80) -- the default on most systems. It occurs because the platform BIOS may erroneously enable an energy-efficiency setting -- MSR_IA32_POWER_CTL BIT-EE, which is not recommended to be enabled on this SKU. On the failing systems, this BIOS issue was not discovered when the desktop motherboard was tested with Windows, because the BIOS also neglects to provide the ACPI/CPPC table, that Windows requires to enable HWP, and so Windows runs in legacy P-state mode, where this setting has no effect. Linux' intel_pstate driver does not require ACPI/CPPC to enable HWP, and so it runs in HWP mode, exposing this incorrect BIOS configuration. There are several ways to address this problem. First, Linux can also run in legacy P-state mode on this system. As intel_pstate is how Linux enables HWP, booting with "intel_pstate=disable" will run in acpi-cpufreq/ondemand legacy p-state mode. Or second, the "performance" governor can be used with intel_pstate, which will modify HWP.EPP to 0. Or third, starting in 4.10, the /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference attribute in can be updated from "balance_power" to "performance". Or fourth, apply this patch, which fixes the erroneous setting of MSR_IA32_POWER_CTL BIT_EE on this model, allowing the default configuration to function as designed. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Len Brown <len.brown@intel.com> Cc: 4.6+ <stable@vger.kernel.org> # 4.6+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'net/sched/em_canid.c')