From d211e1bf96b26bf40cbfa8d456f8e3e90da17f2a Mon Sep 17 00:00:00 2001 From: Park Bumgyu Date: Thu, 9 Aug 2018 13:54:59 +0900 Subject: [PATCH] sched: ems: update topology after energy table creation Change-Id: I12c66b041b801c331d1b631b035bf99d07af763f Signed-off-by: Park Bumgyu --- drivers/base/arch_topology.c | 6 ++++++ include/linux/arch_topology.h | 1 + kernel/sched/ems/energy.c | 2 ++ 3 files changed, 9 insertions(+) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index e47bd0876999..14f047e73ec3 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -58,6 +58,12 @@ static ssize_t cpu_capacity_show(struct device *dev, static void update_topology_flags_workfn(struct work_struct *work); static DECLARE_WORK(update_topology_flags_work, update_topology_flags_workfn); +void topology_update(void) +{ + if (topology_detect_flags()) + schedule_work(&update_topology_flags_work); +} + static ssize_t cpu_capacity_store(struct device *dev, struct device_attribute *attr, const char *buf, diff --git a/include/linux/arch_topology.h b/include/linux/arch_topology.h index b54a4257257c..f125d4fe1ec5 100644 --- a/include/linux/arch_topology.h +++ b/include/linux/arch_topology.h @@ -15,6 +15,7 @@ int topology_core_flags(void); int topology_cluster_flags(void); int topology_cpu_flags(void); int topology_update_cpu_topology(void); +void topology_update(void); struct device_node; bool topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu); diff --git a/kernel/sched/ems/energy.c b/kernel/sched/ems/energy.c index d7a13a35e642..e55fe5986e8c 100644 --- a/kernel/sched/ems/energy.c +++ b/kernel/sched/ems/energy.c @@ -479,6 +479,8 @@ void init_sched_energy_table(struct cpumask *cpus, int table_size, update_group_capacity(sd, cpu); rcu_read_unlock(); } + + topology_update(); } static int __init init_sched_energy_data(void) -- 2.20.1