Skip to content

Commit 9942f79

Browse files
Rik van RielIngo Molnar
Rik van Riel
authored and
Ingo Molnar
committed
sched/numa: Export info needed for NUMA balancing on complex topologies
Export some information that is necessary to do placement of tasks on systems with multi-level NUMA topologies. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: mgorman@suse.de Cc: chegu_vinod@hp.com Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/1413530994-9732-2-git-send-email-riel@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent f3a7e1a commit 9942f79

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

kernel/sched/core.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -6129,6 +6129,7 @@ static void claim_allocations(int cpu, struct sched_domain *sd)
61296129
#ifdef CONFIG_NUMA
61306130
static int sched_domains_numa_levels;
61316131
static int *sched_domains_numa_distance;
6132+
int sched_max_numa_distance;
61326133
static struct cpumask ***sched_domains_numa_masks;
61336134
static int sched_domains_curr_level;
61346135
#endif
@@ -6300,7 +6301,7 @@ static void sched_numa_warn(const char *str)
63006301
printk(KERN_WARNING "\n");
63016302
}
63026303

6303-
static bool find_numa_distance(int distance)
6304+
bool find_numa_distance(int distance)
63046305
{
63056306
int i;
63066307

@@ -6447,6 +6448,7 @@ static void sched_init_numa(void)
64476448
sched_domain_topology = tl;
64486449

64496450
sched_domains_numa_levels = level;
6451+
sched_max_numa_distance = sched_domains_numa_distance[level - 1];
64506452
}
64516453

64526454
static void sched_domains_numa_masks_set(int cpu)

kernel/sched/sched.h

+5
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,11 @@ static inline u64 rq_clock_task(struct rq *rq)
678678
return rq->clock_task;
679679
}
680680

681+
#ifdef CONFIG_NUMA
682+
extern int sched_max_numa_distance;
683+
extern bool find_numa_distance(int distance);
684+
#endif
685+
681686
#ifdef CONFIG_NUMA_BALANCING
682687
extern void sched_setnuma(struct task_struct *p, int node);
683688
extern int migrate_task_to(struct task_struct *p, int cpu);

0 commit comments

Comments
 (0)