Skip to content

Commit

Permalink
sched: add arch_update_cpu_topology hook.
Browse files Browse the repository at this point in the history
Will be called each time the scheduling domains are rebuild.
Needed for architectures that don't have a static cpu topology.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Heiko Carstens authored and Ingo Molnar committed Mar 21, 2008
1 parent 9aefd0a commit 22e52b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
for_each_online_node(node) \
if (nr_cpus_node(node))

void arch_update_cpu_topology(void);

/* Conform to ACPI 2.0 SLIT distance definitions */
#define LOCAL_DISTANCE 10
#define REMOTE_DISTANCE 20
Expand Down
5 changes: 5 additions & 0 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -6807,6 +6807,10 @@ static int ndoms_cur; /* number of sched domains in 'doms_cur' */
*/
static cpumask_t fallback_doms;

void __attribute__((weak)) arch_update_cpu_topology(void)
{
}

/*
* Set up scheduler domains and groups. Callers must hold the hotplug lock.
* For now this just excludes isolated cpus, but could be used to
Expand All @@ -6816,6 +6820,7 @@ static int arch_init_sched_domains(const cpumask_t *cpu_map)
{
int err;

arch_update_cpu_topology();
ndoms_cur = 1;
doms_cur = kmalloc(sizeof(cpumask_t), GFP_KERNEL);
if (!doms_cur)
Expand Down

0 comments on commit 22e52b0

Please sign in to comment.