ANDROID: drivers base/arch_topology: enforce SCHED_CAPACITY_SCALE as highest CPU capacity
The default CPU capacity is SCHED_CAPACITY_SCALE (1024). On a heterogeneous system (hmp) this value can be smaller for some cpus. The CPU capacity parsing code normalizes the capacity-dmips-mhz properties w.r.t. the highest value found while parsing the DT to SCHED_CAPACITY_SCALE. CPU capacity can also be changed by writing to /sys/devices/system/cpu/cpu*/cpu_capacity. To make sure that a subset of all online cpus still has a CPU capacity value of SCHED_CAPACITY_SCALE enforce in the appropriate sysfs attribute store function cpu_capacity_store(). This will avoid weird setup's like transforming an hmp into an smp system with a CPU capacity < SCHED_CAPACITY_SCALE for all cpus. The current cpu_capacity_store() assumes that all cpus of a cluster have the same CPU capacity value which is true for existing hmp systems (e.g. big.LITTLE). This assumption is also used by this patch. If the new CPU capacity value for a cpu is smaller than SCHED_CAPACITY_SCALE we iterate over the cpus which do not belong to the cpu's cluster and check that there is still a cpu with CPU capacity equal SCHED_CAPACITY_SCALE. The use of &cpu_topology[this_cpu].core_sibling is replaced by topology_core_cpumask(this_cpu). Signed-off-by:Dietmar Eggemann <dietmar.eggemann@arm.com> Change-Id: I2a197a012edd9f20b1c794f27567b891c0d2de12 Signed-off-by:
Chris Redpath <chris.redpath@arm.com> Git-commit: 73e184bc Git-repo: https://android.googlesource.com/kernel/common/ Signed-off-by:
Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Loading
Please register or sign in to comment