Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fe43114 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more power management updates from Rafael Wysocki:
 "These include one big-ticket item which is the rework of the idle loop
  in order to prevent CPUs from spending too much time in shallow idle
  states. It reduces idle power on some systems by 10% or more and may
  improve performance of workloads in which the idle loop overhead
  matters. This has been in the works for several weeks and it has been
  tested and reviewed quite thoroughly.

  Also included are changes that finalize the cpufreq cleanup moving
  frequency table validation from drivers to the core, a few fixes and
  cleanups of cpufreq drivers, a cpuidle documentation update and a PM
  QoS core update to mark the expected switch fall-throughs in it.

  Specifics:

   - Rework the idle loop in order to prevent CPUs from spending too
     much time in shallow idle states by making it stop the scheduler
     tick before putting the CPU into an idle state only if the idle
     duration predicted by the idle governor is long enough.

     That required the code to be reordered to invoke the idle governor
     before stopping the tick, among other things (Rafael Wysocki,
     Frederic Weisbecker, Arnd Bergmann).

   - Add the missing description of the residency sysfs attribute to the
     cpuidle documentation (Prashanth Prakash).

   - Finalize the cpufreq cleanup moving frequency table validation from
     drivers to the core (Viresh Kumar).

   - Fix a clock leak regression in the armada-37xx cpufreq driver
     (Gregory Clement).

   - Fix the initialization of the CPU performance data structures for
     shared policies in the CPPC cpufreq driver (Shunyong Yang).

   - Clean up the ti-cpufreq, intel_pstate and CPPC cpufreq drivers a
     bit (Viresh Kumar, Rafael Wysocki).

   - Mark the expected switch fall-throughs in the PM QoS core (Gustavo
     Silva)"

* tag 'pm-4.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (23 commits)
  tick-sched: avoid a maybe-uninitialized warning
  cpufreq: Drop cpufreq_table_validate_and_show()
  cpufreq: SCMI: Don't validate the frequency table twice
  cpufreq: CPPC: Initialize shared perf capabilities of CPUs
  cpufreq: armada-37xx: Fix clock leak
  cpufreq: CPPC: Don't set transition_latency
  cpufreq: ti-cpufreq: Use builtin_platform_driver()
  cpufreq: intel_pstate: Do not include debugfs.h
  PM / QoS: mark expected switch fall-throughs
  cpuidle: Add definition of residency to sysfs documentation
  time: hrtimer: Use timerqueue_iterate_next() to get to the next timer
  nohz: Avoid duplication of code related to got_idle_tick
  nohz: Gather tick_sched booleans under a common flag field
  cpuidle: menu: Avoid selecting shallow states with stopped tick
  cpuidle: menu: Refine idle state selection for running tick
  sched: idle: Select idle state before stopping the tick
  time: hrtimer: Introduce hrtimer_next_event_without()
  time: tick-sched: Split tick_nohz_stop_sched_tick()
  cpuidle: Return nohz hint from cpuidle_select()
  jiffies: Introduce USER_TICK_USEC and redefine TICK_USEC
  ...
parents 96973767 51798dea
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -97,12 +97,10 @@ flags - flags of the cpufreq driver
==================================================================
For details about OPP, see Documentation/power/opp.txt

dev_pm_opp_init_cpufreq_table - cpufreq framework typically is initialized with
	cpufreq_table_validate_and_show() which is provided with the list of
	frequencies that are available for operation. This function provides
	a ready to use conversion routine to translate the OPP layer's internal
	information about the available frequencies into a format readily
	providable to cpufreq.
dev_pm_opp_init_cpufreq_table -
	This function provides a ready to use conversion routine to translate
	the OPP layer's internal information about the available frequencies
	into a format readily providable to cpufreq.

	WARNING: Do not use this function in interrupt context.

@@ -112,7 +110,7 @@ dev_pm_opp_init_cpufreq_table - cpufreq framework typically is initialized with
		/* Do things */
		r = dev_pm_opp_init_cpufreq_table(dev, &freq_table);
		if (!r)
			cpufreq_table_validate_and_show(policy, freq_table);
			policy->freq_table = freq_table;
		/* Do other things */
	 }

+2 −4
Original line number Diff line number Diff line
@@ -259,10 +259,8 @@ CPUFREQ_ENTRY_INVALID. The entries don't need to be in sorted in any
particular order, but if they are cpufreq core will do DVFS a bit
quickly for them as search for best match is faster.

By calling cpufreq_table_validate_and_show(), the cpuinfo.min_freq and
cpuinfo.max_freq values are detected, and policy->min and policy->max
are set to the same values. This is helpful for the per-CPU
initialization stage.
The cpufreq table is verified automatically by the core if the policy contains a
valid pointer in its policy->freq_table field.

cpufreq_frequency_table_verify() assures that at least one valid
frequency is within policy->min and policy->max, and all other criteria
+6 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ total 0
-r--r--r-- 1 root root 4096 Feb  8 10:42 latency
-r--r--r-- 1 root root 4096 Feb  8 10:42 name
-r--r--r-- 1 root root 4096 Feb  8 10:42 power
-r--r--r-- 1 root root 4096 Feb  8 10:42 residency
-r--r--r-- 1 root root 4096 Feb  8 10:42 time
-r--r--r-- 1 root root 4096 Feb  8 10:42 usage

@@ -50,6 +51,7 @@ total 0
-r--r--r-- 1 root root 4096 Feb  8 10:42 latency
-r--r--r-- 1 root root 4096 Feb  8 10:42 name
-r--r--r-- 1 root root 4096 Feb  8 10:42 power
-r--r--r-- 1 root root 4096 Feb  8 10:42 residency
-r--r--r-- 1 root root 4096 Feb  8 10:42 time
-r--r--r-- 1 root root 4096 Feb  8 10:42 usage

@@ -60,6 +62,7 @@ total 0
-r--r--r-- 1 root root 4096 Feb  8 10:42 latency
-r--r--r-- 1 root root 4096 Feb  8 10:42 name
-r--r--r-- 1 root root 4096 Feb  8 10:42 power
-r--r--r-- 1 root root 4096 Feb  8 10:42 residency
-r--r--r-- 1 root root 4096 Feb  8 10:42 time
-r--r--r-- 1 root root 4096 Feb  8 10:42 usage

@@ -70,6 +73,7 @@ total 0
-r--r--r-- 1 root root 4096 Feb  8 10:42 latency
-r--r--r-- 1 root root 4096 Feb  8 10:42 name
-r--r--r-- 1 root root 4096 Feb  8 10:42 power
-r--r--r-- 1 root root 4096 Feb  8 10:42 residency
-r--r--r-- 1 root root 4096 Feb  8 10:42 time
-r--r--r-- 1 root root 4096 Feb  8 10:42 usage
--------------------------------------------------------------------------------
@@ -78,6 +82,8 @@ total 0
* desc : Small description about the idle state (string)
* disable : Option to disable this idle state (bool) -> see note below
* latency : Latency to exit out of this idle state (in microseconds)
* residency : Time after which a state becomes more effecient than any
  shallower state (in microseconds)
* name : Name of the idle state (string)
* power : Power consumed while in this idle state (in milliwatts)
* time : Total time spent in this idle state (in microseconds)
+1 −0
Original line number Diff line number Diff line
@@ -425,6 +425,7 @@ static void xen_pv_play_dead(void) /* used only with HOTPLUG_CPU */
	 * data back is to call:
	 */
	tick_nohz_idle_enter();
	tick_nohz_idle_stop_tick_protected();

	cpuhp_online_idle(CPUHP_AP_ONLINE_IDLE);
}
+2 −0
Original line number Diff line number Diff line
@@ -202,6 +202,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
	cur_frequency = clk_get_rate(clk);
	if (!cur_frequency) {
		dev_err(cpu_dev, "Failed to get clock rate for CPU\n");
		clk_put(clk);
		return -EINVAL;
	}

@@ -210,6 +211,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
		return -EINVAL;

	armada37xx_cpufreq_dvfs_setup(nb_pm_base, clk, dvfs->divider);
	clk_put(clk);

	for (load_lvl = ARMADA_37XX_DVFS_LOAD_0; load_lvl < LOAD_LEVEL_NR;
	     load_lvl++) {
Loading