Currently the build for a single-core (e.g. user-mode) Linux is broken and this configuration is required (at least) to run some network tests. The main issues for the current code support on single-core systems are: 1. {se,rq}::sched_avg is not available nor maintained for !SMP systems This means that load and utilisation signals are NOT available in single core systems. All the EAS code depends on these signals. 2. sched_group_energy is also SMP dependant. Again this means that all the EAS setup and preparation code (energyn model initialization) has to be properly guarded/disabled for !SMP systems. 3. SchedFreq depends on utilization signal, which is not available on !SMP systems. 4. SchedTune is useless on unicore systems if SchedFreq is not available. 5. WALT machinery is not required on single-core systems. This patch addresses all these issues by enforcing some constraints for single-core systems: a) WALT, SchedTune and SchedTune are now dependant on SMP b) The default governor for !SMP systems is INTERACTIVE c) The energy model initialisation/build functions are d) Other minor code re-arrangements and CONFIG_SMP guarding to enable single core builds. Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com> Signed-off-by: Andres Oportus <andresoportus@google.com>
44 lines
999 B
C
44 lines
999 B
C
#ifndef _LINUX_SCHED_ENERGY_H
|
|
#define _LINUX_SCHED_ENERGY_H
|
|
|
|
#include <linux/sched.h>
|
|
#include <linux/slab.h>
|
|
|
|
/*
|
|
* There doesn't seem to be an NR_CPUS style max number of sched domain
|
|
* levels so here's an arbitrary constant one for the moment.
|
|
*
|
|
* The levels alluded to here correspond to entries in struct
|
|
* sched_domain_topology_level that are meant to be populated by arch
|
|
* specific code (topology.c).
|
|
*/
|
|
#define NR_SD_LEVELS 8
|
|
|
|
#define SD_LEVEL0 0
|
|
#define SD_LEVEL1 1
|
|
#define SD_LEVEL2 2
|
|
#define SD_LEVEL3 3
|
|
#define SD_LEVEL4 4
|
|
#define SD_LEVEL5 5
|
|
#define SD_LEVEL6 6
|
|
#define SD_LEVEL7 7
|
|
|
|
/*
|
|
* Convenience macro for iterating through said sd levels.
|
|
*/
|
|
#define for_each_possible_sd_level(level) \
|
|
for (level = 0; level < NR_SD_LEVELS; level++)
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
extern struct sched_group_energy *sge_array[NR_CPUS][NR_SD_LEVELS];
|
|
|
|
void init_sched_energy_costs(void);
|
|
|
|
#else
|
|
|
|
#define init_sched_energy_costs() do { } while (0)
|
|
|
|
#endif /* CONFIG_SMP */
|
|
|
|
#endif
|