summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorAnton Arapov <anton@redhat.com>2012-05-15 10:24:02 +0200
committerAnton Arapov <anton@redhat.com>2012-05-15 10:24:02 +0200
commitfe2895d3d55146cac65b273c0f83e2c7e543cd0e (patch)
tree79e126e92ac8357191613fd166826bcb2cac0047 /arch/x86/kernel
parentc0e33d8195b424eb29432998c565d09398933d32 (diff)
downloadkernel-uprobes-fe2895d3d55146cac65b273c0f83e2c7e543cd0e.tar.gz
kernel-uprobes-fe2895d3d55146cac65b273c0f83e2c7e543cd0e.tar.xz
kernel-uprobes-fe2895d3d55146cac65b273c0f83e2c7e543cd0e.zip
fedora kernel: be402e5a53d5ac42b5a17e0a207dae63a67f2786v3.3.6-1
Signed-off-by: Anton Arapov <anton@redhat.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/setup_percpu.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 71f4727da37..5a98aa27218 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -185,10 +185,22 @@ void __init setup_per_cpu_areas(void)
#endif
rc = -EINVAL;
if (pcpu_chosen_fc != PCPU_FC_PAGE) {
- const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
const size_t dyn_size = PERCPU_MODULE_RESERVE +
PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;
+ size_t atom_size;
+ /*
+ * On 64bit, use PMD_SIZE for atom_size so that embedded
+ * percpu areas are aligned to PMD. This, in the future,
+ * can also allow using PMD mappings in vmalloc area. Use
+ * PAGE_SIZE on 32bit as vmalloc space is highly contended
+ * and large vmalloc area allocs can easily fail.
+ */
+#ifdef CONFIG_X86_64
+ atom_size = PMD_SIZE;
+#else
+ atom_size = PAGE_SIZE;
+#endif
rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
dyn_size, atom_size,
pcpu_cpu_distance,