b/Documentation/kernel-parameters.txt
@@ -3320,6 +3320,24 @@ bytes respectively. Such letter suffixes can
also be entirely omitted.
that this also can be controlled per-workqueue for
workqueues visible under /sys/bus/workqueue/.
+ workqueue.power_efficient
+ Workqueues can be performance or power-oriented.
+ Currently, most workqueues are bound to the CPU they
+ were created on. This gives good performance (due to
+ cache effects) at the cost of potentially waking up
+ otherwise idle cores (Idle from scheduler's perspective.
+ Which may or may not be physically idle) just to process
+ some work. To save power, we can allow the work to be
+ rescheduled on a core that is already awake.
+
+ Workqueues created with the WQ_UNBOUND flag will allow
+ some power savings. However, we don't change the
+ default behaviour of the system. To enable power-saving
+ behaviour, a new config option CONFIG_WQ_POWER_EFFICIENT
+ needs to be turned on. This option can also be
+ overridden by the workqueue.power_efficient boot
+ parameter.
+
x2apic_phys [X86-64,APIC] Use x2apic physical mode instead of
default x2apic cluster mode on platforms
supporting x2apic.
@@ -302,6 +302,9 @@ enum {
WQ_HIGHPRI = 1 << 4, /* high priority */
WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */
WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */
+ WQ_POWER_EFFICIENT = 1 << 7, /* WQ_UNBOUND, for power
+ * saving, if wq_power_efficient is
+ * enabled. Unused otherwise. */
__WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */
__WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */
@@ -263,6 +263,27 @@ config PM_GENERIC_DOMAINS
bool
depends on PM
+config WQ_POWER_EFFICIENT
+ bool "Workqueue allocated as UNBOUND (by default) for power efficiency"
+ depends on PM
+ default n
+ help
+ Workqueues can be performance or power-oriented. Currently, most
+ workqueues are bound to the CPU they were created on. This gives good
+ performance (due to cache effects) at the cost of potentially waking
+ up otherwise idle cores (Idle from scheduler's perspective. Which may
+ or may not be physically idle) just to process some work. To save
+ power, we can allow the work to be rescheduled on a core that is
+ already awake.
+
+ Workqueues created with the WQ_UNBOUND flag will allow some power
+ savings. However, we don't change the default behaviour of the
+ system. To enable power-saving behaviour, a new config option
+ CONFIG_WQ_POWER_EFFICIENT needs to be turned on. This option can also
+ be overridden by the workqueue.power_efficient boot parameter.
+
+ If in doubt, say N.
+
config PM_GENERIC_DOMAINS_SLEEP
def_bool y
depends on PM_SLEEP && PM_GENERIC_DOMAINS
@@ -272,6 +272,14 @@ static cpumask_var_t *wq_numa_possible_cpumask;
static bool wq_disable_numa;
module_param_named(disable_numa, wq_disable_numa, bool, 0444);
+#ifdef CONFIG_WQ_POWER_EFFICIENT
+static bool wq_power_efficient = true;
+#else
+static bool wq_power_efficient;
+#endif
+
+module_param_named(power_efficient, wq_power_efficient, bool, 0444);
+
static bool wq_numa_enabled; /* unbound NUMA affinity enabled */
/* buf for wq_update_unbound_numa_attrs(), protected by CPU hotplug