Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (46 commits) powerpc64: convert to dynamic percpu allocator sparc64: use embedding percpu first chunk allocator percpu: kill lpage first chunk allocator x86,percpu: use embedding for 64bit NUMA and page for 32bit NUMA percpu: update embedding first chunk allocator to handle sparse units percpu: use group information to allocate vmap areas sparsely vmalloc: implement pcpu_get_vm_areas() vmalloc: separate out insert_vmalloc_vm() percpu: add chunk->base_addr percpu: add pcpu_unit_offsets[] percpu: introduce pcpu_alloc_info and pcpu_group_info percpu: move pcpu_lpage_build_unit_map() and pcpul_lpage_dump_cfg() upward percpu: add @align to pcpu_fc_alloc_fn_t percpu: make @dyn_size mandatory for pcpu_setup_first_chunk() percpu: drop @static_size from first chunk allocators percpu: generalize first chunk allocator selection percpu: build first chunk allocators selectively percpu: rename 4k first chunk allocator to page percpu: improve boot messages percpu: fix pcpu_reclaim() locking ... Fix trivial conflict as by Tejun Heo in kernel/sched.c
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
#include <asm/cache.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/mmu.h>
|
||||
#include <asm/mmu-hash64.h>
|
||||
#include <asm/firmware.h>
|
||||
#include <asm/xmon.h>
|
||||
#include <asm/udbg.h>
|
||||
@@ -569,25 +570,53 @@ void cpu_die(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define PCPU_DYN_SIZE ()
|
||||
|
||||
static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
|
||||
{
|
||||
return __alloc_bootmem_node(NODE_DATA(cpu_to_node(cpu)), size, align,
|
||||
__pa(MAX_DMA_ADDRESS));
|
||||
}
|
||||
|
||||
static void __init pcpu_fc_free(void *ptr, size_t size)
|
||||
{
|
||||
free_bootmem(__pa(ptr), size);
|
||||
}
|
||||
|
||||
static int pcpu_cpu_distance(unsigned int from, unsigned int to)
|
||||
{
|
||||
if (cpu_to_node(from) == cpu_to_node(to))
|
||||
return LOCAL_DISTANCE;
|
||||
else
|
||||
return REMOTE_DISTANCE;
|
||||
}
|
||||
|
||||
void __init setup_per_cpu_areas(void)
|
||||
{
|
||||
int i;
|
||||
unsigned long size;
|
||||
char *ptr;
|
||||
const size_t dyn_size = PERCPU_MODULE_RESERVE + PERCPU_DYNAMIC_RESERVE;
|
||||
size_t atom_size;
|
||||
unsigned long delta;
|
||||
unsigned int cpu;
|
||||
int rc;
|
||||
|
||||
/* Copy section for each CPU (we discard the original) */
|
||||
size = ALIGN(__per_cpu_end - __per_cpu_start, PAGE_SIZE);
|
||||
#ifdef CONFIG_MODULES
|
||||
if (size < PERCPU_ENOUGH_ROOM)
|
||||
size = PERCPU_ENOUGH_ROOM;
|
||||
#endif
|
||||
/*
|
||||
* Linear mapping is one of 4K, 1M and 16M. For 4K, no need
|
||||
* to group units. For larger mappings, use 1M atom which
|
||||
* should be large enough to contain a number of units.
|
||||
*/
|
||||
if (mmu_linear_psize == MMU_PAGE_4K)
|
||||
atom_size = PAGE_SIZE;
|
||||
else
|
||||
atom_size = 1 << 20;
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
ptr = alloc_bootmem_pages_node(NODE_DATA(cpu_to_node(i)), size);
|
||||
rc = pcpu_embed_first_chunk(0, dyn_size, atom_size, pcpu_cpu_distance,
|
||||
pcpu_fc_alloc, pcpu_fc_free);
|
||||
if (rc < 0)
|
||||
panic("cannot initialize percpu area (err=%d)", rc);
|
||||
|
||||
paca[i].data_offset = ptr - __per_cpu_start;
|
||||
memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
|
||||
}
|
||||
delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start;
|
||||
for_each_possible_cpu(cpu)
|
||||
paca[cpu].data_offset = delta + pcpu_unit_offsets[cpu];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -37,12 +37,6 @@ jiffies = jiffies_64 + 4;
|
||||
#endif
|
||||
SECTIONS
|
||||
{
|
||||
/* Sections to be discarded. */
|
||||
/DISCARD/ : {
|
||||
*(.exitcall.exit)
|
||||
EXIT_DATA
|
||||
}
|
||||
|
||||
. = KERNELBASE;
|
||||
|
||||
/*
|
||||
@@ -298,4 +292,7 @@ SECTIONS
|
||||
. = ALIGN(PAGE_SIZE);
|
||||
_end = . ;
|
||||
PROVIDE32 (end = .);
|
||||
|
||||
/* Sections to be discarded. */
|
||||
DISCARDS
|
||||
}
|
||||
|
Reference in New Issue
Block a user