Commit 5c45bf27 authored by Siddha, Suresh B's avatar Siddha, Suresh B Committed by Linus Torvalds
Browse files

[PATCH] sched: mc/smt power savings sched policy



sysfs entries 'sched_mc_power_savings' and 'sched_smt_power_savings' in
/sys/devices/system/cpu/ control the MC/SMT power savings policy for the
scheduler.

Based on the values (1-enable, 0-disable) for these controls, sched groups
cpu power will be determined for different domains.  When power savings
policy is enabled and under light load conditions, scheduler will minimize
the physical packages/cpu cores carrying the load and thus conserving
power(with a perf impact based on the workload characteristics...  see OLS
2005 CMP kernel scheduler paper for more details..)

Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Con Kolivas <kernel@kolivas.org>
Cc: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 36938169
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -448,9 +448,11 @@ cpumask_t cpu_coregroup_map(int cpu)
	struct cpuinfo_x86 *c = cpu_data + cpu;
	/*
	 * For perf, we return last level cache shared map.
	 * TBD: when power saving sched policy is added, we will return
	 *      cpu_core_map when power saving policy is enabled
	 * And for power savings, we return cpu_core_map
	 */
	if (sched_mc_power_savings || sched_smt_power_savings)
		return cpu_core_map[cpu];
	else
		return c->llc_shared_map;
}

+5 −3
Original line number Diff line number Diff line
@@ -455,9 +455,11 @@ cpumask_t cpu_coregroup_map(int cpu)
	struct cpuinfo_x86 *c = cpu_data + cpu;
	/*
	 * For perf, we return last level cache shared map.
	 * TBD: when power saving sched policy is added, we will return
	 *      cpu_core_map when power saving policy is enabled
	 * And for power savings, we return cpu_core_map
	 */
	if (sched_mc_power_savings || sched_smt_power_savings)
		return cpu_core_map[cpu];
	else
		return c->llc_shared_map;
}

+9 −1
Original line number Diff line number Diff line
@@ -143,5 +143,13 @@ EXPORT_SYMBOL_GPL(get_cpu_sysdev);

int __init cpu_dev_init(void)
{
	return sysdev_class_register(&cpu_sysdev_class);
	int err;

	err = sysdev_class_register(&cpu_sysdev_class);
#if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT)
	if (!err)
		err = sched_create_sysfs_power_savings_entries(&cpu_sysdev_class);
#endif

	return err;
}
+5 −0
Original line number Diff line number Diff line
@@ -112,4 +112,9 @@ extern unsigned long node_remap_size[];

extern cpumask_t cpu_coregroup_map(int cpu);

#ifdef CONFIG_SMP
#define mc_capable()	(boot_cpu_data.x86_max_cores > 1)
#define smt_capable()	(smp_num_siblings > 1)
#endif

#endif /* _ASM_I386_TOPOLOGY_H */
+1 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ void build_cpu_to_node_map(void);
#define topology_core_id(cpu)			(cpu_data(cpu)->core_id)
#define topology_core_siblings(cpu)		(cpu_core_map[cpu])
#define topology_thread_siblings(cpu)		(cpu_sibling_map[cpu])
#define smt_capable() 				(smp_num_siblings > 1)
#endif

#include <asm-generic/topology.h>
Loading