Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23088
b: refs/heads/master
c: 63872f8
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and Linus Torvalds committed Mar 23, 2006
1 parent 6a1aa30 commit 34ab891
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 5a6b7951bfcca7f45f44269ea87417c74558daf8
refs/heads/master: 63872f87a151413100678f110d1556026002809e
11 changes: 8 additions & 3 deletions trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,19 +333,24 @@ static void __init setup_per_cpu_areas(void)
{
unsigned long size, i;
char *ptr;
unsigned long nr_possible_cpus = num_possible_cpus();

/* Copy section for each CPU (we discard the original) */
size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES);
#ifdef CONFIG_MODULES
if (size < PERCPU_ENOUGH_ROOM)
size = PERCPU_ENOUGH_ROOM;
#endif
ptr = alloc_bootmem(size * nr_possible_cpus);

ptr = alloc_bootmem(size * NR_CPUS);

for (i = 0; i < NR_CPUS; i++, ptr += size) {
for (i = 0; i < NR_CPUS; i++) {
if (!cpu_possible(i)) {
__per_cpu_offset[i] = (char*)0 - __per_cpu_start;
continue;
}
__per_cpu_offset[i] = ptr - __per_cpu_start;
memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
ptr += size;
}
}
#endif /* !__GENERIC_PER_CPU */
Expand Down

0 comments on commit 34ab891

Please sign in to comment.