mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
hperf_hmp: add sched domains initialization.
has two pointers to A15 and A7 scheduling groups(struct sched_group). Signed-off-by: Tarek Dakhran <t.dakhran <at> samsung.com> Signed-off-by: Sergey Dyasly <s.dyasly <at> samsung.com> Signed-off-by: Dmitriy Safonov <d.safonov <at> partner.samsung.com> Signed-off-by: Arseniy Krasnov <a.krasnov <at> samsung.com> Signed-off-by: Ilya Maximets <i.maximets <at> samsung.com> Signed-off-by: memeka <mihailescu2m@gmail.com>
This commit is contained in:
committed by
Mauro (mdrjr) Ribeiro
parent
b8ac462153
commit
29894de8f1
@@ -1111,6 +1111,10 @@ struct sched_domain {
|
||||
|
||||
u64 avg_scan_cost; /* select_idle_sibling */
|
||||
|
||||
#ifdef CONFIG_HPERF_HMP
|
||||
struct sched_group *a15_group;
|
||||
struct sched_group *a7_group;
|
||||
#endif
|
||||
#ifdef CONFIG_SCHEDSTATS
|
||||
/* load_balance() stats */
|
||||
unsigned int lb_count[CPU_MAX_IDLE_TYPES];
|
||||
|
||||
@@ -91,6 +91,16 @@
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/sched.h>
|
||||
|
||||
#ifdef CONFIG_HPERF_HMP
|
||||
/* cpumask for A15 cpus */
|
||||
static DECLARE_BITMAP(cpu_fastest_bits, CONFIG_NR_CPUS);
|
||||
struct cpumask *cpu_fastest_mask = to_cpumask(cpu_fastest_bits);
|
||||
|
||||
/* cpumask for A7 cpus */
|
||||
static DECLARE_BITMAP(cpu_slowest_bits, CONFIG_NR_CPUS);
|
||||
struct cpumask *cpu_slowest_mask = to_cpumask(cpu_slowest_bits);
|
||||
#endif
|
||||
|
||||
DEFINE_MUTEX(sched_domains_mutex);
|
||||
DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues);
|
||||
|
||||
@@ -7064,6 +7074,45 @@ static int build_sched_domains(const struct cpumask *cpu_map,
|
||||
|
||||
cpu_attach_domain(sd, d.rd, i);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HPERF_HMP
|
||||
for (i = nr_cpumask_bits - 1; i >= 0; i--) {
|
||||
if (!cpumask_test_cpu(i, cpu_map))
|
||||
continue;
|
||||
|
||||
for (sd = *per_cpu_ptr(d.sd, i); sd; sd = sd->parent) {
|
||||
struct sched_group *sg;
|
||||
sd->a7_group = NULL;
|
||||
sd->a15_group = NULL;
|
||||
|
||||
/* Process only HMP domains */
|
||||
if (!(sd->flags & SD_HMP_BALANCE))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Process sched groups of this domain.
|
||||
* Attach sg to hmp domains.
|
||||
*/
|
||||
sg = sd->groups;
|
||||
do {
|
||||
if (!sg->sgc)
|
||||
goto next_sg;
|
||||
#ifdef CONFIG_SCHED_DEBUG
|
||||
printk(KERN_EMERG "Attaching CPUs 0x%08lX to domain %s\n",
|
||||
sched_group_cpus(sg)->bits[0], sd->name);
|
||||
#endif
|
||||
if (cpumask_intersects(sched_group_cpus(sg),
|
||||
cpu_fastest_mask))
|
||||
sd->a15_group = sg;
|
||||
else
|
||||
sd->a7_group = sg;
|
||||
next_sg:
|
||||
sg = sg->next;
|
||||
} while (sg != sd->groups);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_HPERF_HMP */
|
||||
|
||||
rcu_read_unlock();
|
||||
|
||||
if (rq && sched_debug_enabled) {
|
||||
|
||||
Reference in New Issue
Block a user