Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275510
b: refs/heads/master
c: f6bf1a8
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Nov 14, 2011
1 parent 7532f3b commit 0e877af
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6ed54387dc470fc439cb154724a1ac81d251c126
refs/heads/master: f6bf1a8acd2cb3a92a7b7c9ab03e56a32ac5ece5
45 changes: 38 additions & 7 deletions trunk/arch/s390/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu)
return mask;
}

static void add_cpus_to_mask(struct topology_cpu *tl_cpu,
struct mask_info *book, struct mask_info *core)
static struct mask_info *add_cpus_to_mask(struct topology_cpu *tl_cpu,
struct mask_info *book,
struct mask_info *core,
int z10)
{
unsigned int cpu;

Expand All @@ -88,10 +90,16 @@ static void add_cpus_to_mask(struct topology_cpu *tl_cpu,
cpu_book_id[lcpu] = book->id;
#endif
cpumask_set_cpu(lcpu, &core->mask);
cpu_core_id[lcpu] = core->id;
if (z10) {
cpu_core_id[lcpu] = rcpu;
core = core->next;
} else {
cpu_core_id[lcpu] = core->id;
}
smp_cpu_polarization[lcpu] = tl_cpu->pp;
}
}
return core;
}

static void clear_masks(void)
Expand Down Expand Up @@ -123,18 +131,41 @@ static void tl_to_cores(struct sysinfo_15_1_x *info)
{
#ifdef CONFIG_SCHED_BOOK
struct mask_info *book = &book_info;
struct cpuid cpu_id;
#else
struct mask_info *book = NULL;
#endif
struct mask_info *core = &core_info;
union topology_entry *tle, *end;
int z10 = 0;


#ifdef CONFIG_SCHED_BOOK
get_cpu_id(&cpu_id);
z10 = cpu_id.machine == 0x2097 || cpu_id.machine == 0x2098;
#endif
spin_lock_irq(&topology_lock);
clear_masks();
tle = info->tle;
end = (union topology_entry *)((unsigned long)info + info->length);
while (tle < end) {
#ifdef CONFIG_SCHED_BOOK
if (z10) {
switch (tle->nl) {
case 1:
book = book->next;
book->id = tle->container.id;
break;
case 0:
core = add_cpus_to_mask(&tle->cpu, book, core, z10);
break;
default:
clear_masks();
goto out;
}
tle = next_tle(tle);
continue;
}
#endif
switch (tle->nl) {
#ifdef CONFIG_SCHED_BOOK
case 2:
Expand All @@ -147,7 +178,7 @@ static void tl_to_cores(struct sysinfo_15_1_x *info)
core->id = tle->container.id;
break;
case 0:
add_cpus_to_mask(&tle->cpu, book, core);
add_cpus_to_mask(&tle->cpu, book, core, z10);
break;
default:
clear_masks();
Expand Down Expand Up @@ -328,8 +359,8 @@ void __init s390_init_cpu_topology(void)
for (i = 0; i < TOPOLOGY_NR_MAG; i++)
printk(" %d", info->mag[i]);
printk(" / %d\n", info->mnest);
alloc_masks(info, &core_info, 2);
alloc_masks(info, &core_info, 1);
#ifdef CONFIG_SCHED_BOOK
alloc_masks(info, &book_info, 3);
alloc_masks(info, &book_info, 2);
#endif
}

0 comments on commit 0e877af

Please sign in to comment.