Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250484
b: refs/heads/master
c: 6988f20
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed May 24, 2011
1 parent e1fa413 commit e257d07
Show file tree
Hide file tree
Showing 21 changed files with 29 additions and 30 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: 6ea0c34dac89611126455537552cffe6c7e832ad
refs/heads/master: 6988f20fe04e9ef3aea488cb8ab57fbeb78e12f0
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SECTIONS
__init_begin = ALIGN(PAGE_SIZE);
INIT_TEXT_SECTION(PAGE_SIZE)
INIT_DATA_SECTION(16)
PERCPU(L1_CACHE_BYTES, PAGE_SIZE)
PERCPU_SECTION(L1_CACHE_BYTES)
/* Align to THREAD_SIZE rather than PAGE_SIZE here so any padding page
needed for the THREAD_SIZE aligned init_task gets freed after init */
. = ALIGN(THREAD_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ SECTIONS
#endif
}

PERCPU(32, PAGE_SIZE)
PERCPU_SECTION(32)

#ifndef CONFIG_XIP_KERNEL
. = ALIGN(PAGE_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/blackfin/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ SECTIONS

. = ALIGN(16);
INIT_DATA_SECTION(16)
PERCPU(32, PAGE_SIZE)
PERCPU_SECTION(32)

.exit.data :
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/cris/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SECTIONS
#endif
__vmlinux_end = .; /* Last address of the physical file. */
#ifdef CONFIG_ETRAX_ARCH_V32
PERCPU(32, PAGE_SIZE)
PERCPU_SECTION(32)

.init.ramfs : {
INIT_RAM_FS
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/frv/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SECTIONS
_einittext = .;

INIT_DATA_SECTION(8)
PERCPU(L1_CACHE_BYTES, 4096)
PERCPU_SECTION(L1_CACHE_BYTES)

. = ALIGN(PAGE_SIZE);
__init_end = .;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m32r/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ SECTIONS
__init_begin = .;
INIT_TEXT_SECTION(PAGE_SIZE)
INIT_DATA_SECTION(16)
PERCPU(32, PAGE_SIZE)
PERCPU_SECTION(32)
. = ALIGN(PAGE_SIZE);
__init_end = .;
/* freed after init ends here */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ SECTIONS
EXIT_DATA
}

PERCPU(1 << CONFIG_MIPS_L1_CACHE_SHIFT, PAGE_SIZE)
PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
. = ALIGN(PAGE_SIZE);
__init_end = .;
/* freed after init ends here */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mn10300/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SECTIONS
.exit.text : { EXIT_TEXT; }
.exit.data : { EXIT_DATA; }

PERCPU(32, PAGE_SIZE)
PERCPU_SECTION(32)
. = ALIGN(PAGE_SIZE);
__init_end = .;
/* freed after init ends here */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/parisc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ SECTIONS
EXIT_DATA
}

PERCPU(L1_CACHE_BYTES, PAGE_SIZE)
PERCPU_SECTION(L1_CACHE_BYTES)
. = ALIGN(PAGE_SIZE);
__init_end = .;
/* freed after init ends here */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ SECTIONS
INIT_RAM_FS
}

PERCPU(L1_CACHE_BYTES, PAGE_SIZE)
PERCPU_SECTION(L1_CACHE_BYTES)

. = ALIGN(8);
.machine.desc : AT(ADDR(.machine.desc) - LOAD_OFFSET) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
INIT_DATA_SECTION(0x100)

PERCPU(0x100, PAGE_SIZE)
PERCPU_SECTION(0x100)
. = ALIGN(PAGE_SIZE);
__init_end = .; /* freed after init ends here */

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ SECTIONS
__machvec_end = .;
}

PERCPU(L1_CACHE_BYTES, PAGE_SIZE)
PERCPU_SECTION(L1_CACHE_BYTES)

/*
* .exit.text is discarded at runtime, not link time, to deal with
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ SECTIONS
__sun4v_2insn_patch_end = .;
}

PERCPU(SMP_CACHE_BYTES, PAGE_SIZE)
PERCPU_SECTION(SMP_CACHE_BYTES)

. = ALIGN(PAGE_SIZE);
__init_end = .;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/tile/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
VMLINUX_SYMBOL(_sinitdata) = .;
INIT_DATA_SECTION(16) :data =0
PERCPU(L2_CACHE_BYTES, PAGE_SIZE)
PERCPU_SECTION(L2_CACHE_BYTES)
. = ALIGN(PAGE_SIZE);
VMLINUX_SYMBOL(_einitdata) = .;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/um/include/asm/common.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
INIT_SETUP(0)
}

PERCPU(32, 32)
PERCPU_SECTION(32)

.initcall.init : {
INIT_CALLS
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ SECTIONS
}

#if !defined(CONFIG_X86_64) || !defined(CONFIG_SMP)
PERCPU(INTERNODE_CACHE_BYTES, PAGE_SIZE)
PERCPU_SECTION(INTERNODE_CACHE_BYTES)
#endif

. = ALIGN(PAGE_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/xtensa/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ SECTIONS
INIT_RAM_FS
}

PERCPU(XCHAL_ICACHE_LINESIZE, PAGE_SIZE)
PERCPU_SECTION(XCHAL_ICACHE_LINESIZE)

/* We need this dummy segment here */

Expand Down
17 changes: 8 additions & 9 deletions trunk/include/asm-generic/vmlinux.lds.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* HEAD_TEXT_SECTION
* INIT_TEXT_SECTION(PAGE_SIZE)
* INIT_DATA_SECTION(...)
* PERCPU(CACHELINE_SIZE, PAGE_SIZE)
* PERCPU_SECTION(CACHELINE_SIZE)
* __init_end = .;
*
* _stext = .;
Expand Down Expand Up @@ -731,7 +731,7 @@
*
* Note that this macros defines __per_cpu_load as an absolute symbol.
* If there is no need to put the percpu section at a predetermined
* address, use PERCPU().
* address, use PERCPU_SECTION.
*/
#define PERCPU_VADDR(cacheline, vaddr, phdr) \
VMLINUX_SYMBOL(__per_cpu_load) = .; \
Expand All @@ -742,20 +742,19 @@
. = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu);

/**
* PERCPU - define output section for percpu area, simple version
* PERCPU_SECTION - define output section for percpu area, simple version
* @cacheline: cacheline size
* @align: required alignment
*
* Align to @align and outputs output section for percpu area. This macro
* doesn't manipulate @vaddr or @phdr and __per_cpu_load and
* Align to PAGE_SIZE and outputs output section for percpu area. This
* macro doesn't manipulate @vaddr or @phdr and __per_cpu_load and
* __per_cpu_start will be identical.
*
* This macro is equivalent to ALIGN(@align); PERCPU_VADDR(@cacheline,,)
* This macro is equivalent to ALIGN(PAGE_SIZE); PERCPU_VADDR(@cacheline,,)
* except that __per_cpu_load is defined as a relative symbol against
* .data..percpu which is required for relocatable x86_32 configuration.
*/
#define PERCPU(cacheline, align) \
. = ALIGN(align); \
#define PERCPU_SECTION(cacheline) \
. = ALIGN(PAGE_SIZE); \
.data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__per_cpu_load) = .; \
PERCPU_INPUT(cacheline) \
Expand Down
4 changes: 1 addition & 3 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -2860,9 +2860,7 @@ static int alloc_cwqs(struct workqueue_struct *wq)
}
}

/* just in case, make sure it's actually aligned
* - this is affected by PERCPU() alignment in vmlinux.lds.S
*/
/* just in case, make sure it's actually aligned */
BUG_ON(!IS_ALIGNED(wq->cpu_wq.v, align));
return wq->cpu_wq.v ? 0 : -ENOMEM;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/mm/percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,8 +1216,10 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
PCPU_SETUP_BUG_ON(ai->nr_groups <= 0);
#ifdef CONFIG_SMP
PCPU_SETUP_BUG_ON(!ai->static_size);
PCPU_SETUP_BUG_ON((unsigned long)__per_cpu_start & ~PAGE_MASK);
#endif
PCPU_SETUP_BUG_ON(!base_addr);
PCPU_SETUP_BUG_ON((unsigned long)base_addr & ~PAGE_MASK);
PCPU_SETUP_BUG_ON(ai->unit_size < size_sum);
PCPU_SETUP_BUG_ON(ai->unit_size & ~PAGE_MASK);
PCPU_SETUP_BUG_ON(ai->unit_size < PCPU_MIN_UNIT_SIZE);
Expand Down

0 comments on commit e257d07

Please sign in to comment.