Commit 0257f64b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull power management fixes from Rafael Wysocki:

 - Make the idle loop skip the cpuidle governor .reflect() callback
   after it has skipped the .select() one (Rafael Wysocki)

 - Fix swapped power/energy unit labels in cpupower (Kaushlendra Kumar)

 - Add support for setting EPP via systemd service and intel_pstate
   turbo boost support to cpupower (Jan Kiszka, Zhang Rui)

* tag 'pm-7.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  sched: idle: Make skipping governor callbacks more consistent
  cpupower: Add intel_pstate turbo boost support for Intel platforms
  cpupower: Add support for setting EPP via systemd service
  cpupower: fix swapped power/energy unit labels
parents 61c0b2ae a076cc74
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -359,16 +359,6 @@ noinstr int cpuidle_enter_state(struct cpuidle_device *dev,
int cpuidle_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
		   bool *stop_tick)
{
	/*
	 * If there is only a single idle state (or none), there is nothing
	 * meaningful for the governor to choose. Skip the governor and
	 * always use state 0 with the tick running.
	 */
	if (drv->state_count <= 1) {
		*stop_tick = false;
		return 0;
	}

	return cpuidle_curr_governor->select(drv, dev, stop_tick);
}

+10 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ static void cpuidle_idle_call(void)

		next_state = cpuidle_find_deepest_state(drv, dev, max_latency_ns);
		call_cpuidle(drv, dev, next_state);
	} else {
	} else if (drv->state_count > 1) {
		bool stop_tick = true;

		/*
@@ -239,6 +239,15 @@ static void cpuidle_idle_call(void)
		 * Give the governor an opportunity to reflect on the outcome
		 */
		cpuidle_reflect(dev, entered_state);
	} else {
		tick_nohz_idle_retain_tick();

		/*
		 * If there is only a single idle state (or none), there is
		 * nothing meaningful for the governor to choose.  Skip the
		 * governor and always use state 0.
		 */
		call_cpuidle(drv, dev, 0);
	}

exit_idle:
+5 −0
Original line number Diff line number Diff line
@@ -30,3 +30,8 @@
# its policy for the relative importance of performance versus energy savings to
# the processor. See man CPUPOWER-SET(1) for additional details
#PERF_BIAS=

# Set the Energy Performance Preference
# Available options can be read from
# /sys/devices/system/cpu/cpufreq/policy0/energy_performance_available_preferences
#EPP=
+6 −0
Original line number Diff line number Diff line
@@ -23,4 +23,10 @@ then
    cpupower set -b "$PERF_BIAS" > /dev/null || ESTATUS=1
fi

# apply Energy Performance Preference
if test -n "$EPP"
then
    cpupower set -e "$EPP" > /dev/null || ESTATUS=1
fi

exit $ESTATUS
+5 −1
Original line number Diff line number Diff line
@@ -124,7 +124,11 @@ int cmd_set(int argc, char **argv)
	}

	if (params.turbo_boost) {
		ret = cpupower_set_turbo_boost(turbo_boost);
		if (cpupower_cpu_info.vendor == X86_VENDOR_INTEL)
			ret = cpupower_set_intel_turbo_boost(turbo_boost);
		else
			ret = cpupower_set_generic_turbo_boost(turbo_boost);

		if (ret)
			fprintf(stderr, "Error setting turbo-boost\n");
	}
Loading