summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/kernel/core_apecs.c3
-rw-r--r--arch/alpha/kernel/core_lca.c3
-rw-r--r--arch/alpha/kernel/core_marvel.c4
-rw-r--r--arch/alpha/kernel/core_mcpcia.c6
-rw-r--r--arch/alpha/kernel/core_t2.c2
-rw-r--r--arch/alpha/kernel/core_titan.c6
-rw-r--r--arch/alpha/kernel/core_tsunami.c6
-rw-r--r--arch/alpha/kernel/core_wildfire.c6
-rw-r--r--arch/alpha/kernel/pci-noop.c4
-rw-r--r--arch/alpha/kernel/pci.c4
-rw-r--r--arch/alpha/kernel/pci_iommu.c4
-rw-r--r--arch/arm/kernel/setup.c4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c8
-rw-r--r--arch/arm64/kernel/setup.c2
-rw-r--r--arch/ia64/kernel/mca.c4
-rw-r--r--arch/ia64/mm/tlb.c6
-rw-r--r--arch/ia64/sn/kernel/io_common.c4
-rw-r--r--arch/ia64/sn/kernel/setup.c5
-rw-r--r--arch/m68k/sun3/sun3dvma.c2
-rw-r--r--arch/microblaze/mm/init.c2
-rw-r--r--arch/mips/kernel/setup.c2
-rw-r--r--arch/powerpc/kernel/paca.c2
-rw-r--r--arch/powerpc/kernel/pci_32.c3
-rw-r--r--arch/powerpc/lib/alloc.c2
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c7
-rw-r--r--arch/powerpc/platforms/powermac/nvram.c2
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c6
-rw-r--r--arch/powerpc/sysdev/msi_bitmap.c2
-rw-r--r--arch/um/drivers/net_kern.c2
-rw-r--r--arch/um/drivers/vector_kern.c2
-rw-r--r--arch/um/kernel/initrd.c2
-rw-r--r--arch/unicore32/kernel/setup.c2
-rw-r--r--arch/x86/kernel/acpi/boot.c2
-rw-r--r--arch/x86/kernel/apic/io_apic.c2
-rw-r--r--arch/x86/kernel/e820.c3
-rw-r--r--arch/x86/platform/olpc/olpc_dt.c2
-rw-r--r--arch/xtensa/platforms/iss/network.c2
-rw-r--r--drivers/clk/ti/clk.c2
-rw-r--r--drivers/firmware/efi/memmap.c2
-rw-r--r--drivers/firmware/memmap.c3
-rw-r--r--drivers/macintosh/smu.c2
-rw-r--r--drivers/of/of_reserved_mem.c1
-rw-r--r--include/linux/memblock.h3
-rw-r--r--init/main.c13
-rw-r--r--kernel/power/snapshot.c3
-rw-r--r--lib/cpumask.c2
-rw-r--r--mm/memblock.c8
-rw-r--r--mm/page_alloc.c6
-rw-r--r--mm/percpu.c38
-rw-r--r--mm/sparse.c3
50 files changed, 120 insertions, 96 deletions
diff --git a/arch/alpha/kernel/core_apecs.c b/arch/alpha/kernel/core_apecs.c
index 1bf3eef34c22..6df765ff2b10 100644
--- a/arch/alpha/kernel/core_apecs.c
+++ b/arch/alpha/kernel/core_apecs.c
@@ -346,7 +346,8 @@ apecs_init_arch(void)
346 * Window 1 is direct access 1GB at 1GB 346 * Window 1 is direct access 1GB at 1GB
347 * Window 2 is scatter-gather 8MB at 8MB (for isa) 347 * Window 2 is scatter-gather 8MB at 8MB (for isa)
348 */ 348 */
349 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000, 0); 349 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000,
350 SMP_CACHE_BYTES);
350 hose->sg_pci = NULL; 351 hose->sg_pci = NULL;
351 __direct_map_base = 0x40000000; 352 __direct_map_base = 0x40000000;
352 __direct_map_size = 0x40000000; 353 __direct_map_size = 0x40000000;
diff --git a/arch/alpha/kernel/core_lca.c b/arch/alpha/kernel/core_lca.c
index 81c0c43635b0..57e0750419f2 100644
--- a/arch/alpha/kernel/core_lca.c
+++ b/arch/alpha/kernel/core_lca.c
@@ -275,7 +275,8 @@ lca_init_arch(void)
275 * Note that we do not try to save any of the DMA window CSRs 275 * Note that we do not try to save any of the DMA window CSRs
276 * before setting them, since we cannot read those CSRs on LCA. 276 * before setting them, since we cannot read those CSRs on LCA.
277 */ 277 */
278 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000, 0); 278 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000,
279 SMP_CACHE_BYTES);
279 hose->sg_pci = NULL; 280 hose->sg_pci = NULL;
280 __direct_map_base = 0x40000000; 281 __direct_map_base = 0x40000000;
281 __direct_map_size = 0x40000000; 282 __direct_map_size = 0x40000000;
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index 8a568c4d8e81..c1d0c18c71ca 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -82,7 +82,7 @@ mk_resource_name(int pe, int port, char *str)
82 char *name; 82 char *name;
83 83
84 sprintf(tmp, "PCI %s PE %d PORT %d", str, pe, port); 84 sprintf(tmp, "PCI %s PE %d PORT %d", str, pe, port);
85 name = memblock_alloc(strlen(tmp) + 1, 0); 85 name = memblock_alloc(strlen(tmp) + 1, SMP_CACHE_BYTES);
86 strcpy(name, tmp); 86 strcpy(name, tmp);
87 87
88 return name; 88 return name;
@@ -117,7 +117,7 @@ alloc_io7(unsigned int pe)
117 return NULL; 117 return NULL;
118 } 118 }
119 119
120 io7 = memblock_alloc(sizeof(*io7), 0); 120 io7 = memblock_alloc(sizeof(*io7), SMP_CACHE_BYTES);
121 io7->pe = pe; 121 io7->pe = pe;
122 raw_spin_lock_init(&io7->irq_lock); 122 raw_spin_lock_init(&io7->irq_lock);
123 123
diff --git a/arch/alpha/kernel/core_mcpcia.c b/arch/alpha/kernel/core_mcpcia.c
index b1549db54260..74b1d018124c 100644
--- a/arch/alpha/kernel/core_mcpcia.c
+++ b/arch/alpha/kernel/core_mcpcia.c
@@ -364,9 +364,11 @@ mcpcia_startup_hose(struct pci_controller *hose)
364 * Window 1 is scatter-gather (up to) 1GB at 1GB (for pci) 364 * Window 1 is scatter-gather (up to) 1GB at 1GB (for pci)
365 * Window 2 is direct access 2GB at 2GB 365 * Window 2 is direct access 2GB at 2GB
366 */ 366 */
367 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000, 0); 367 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000,
368 SMP_CACHE_BYTES);
368 hose->sg_pci = iommu_arena_new(hose, 0x40000000, 369 hose->sg_pci = iommu_arena_new(hose, 0x40000000,
369 size_for_memory(0x40000000), 0); 370 size_for_memory(0x40000000),
371 SMP_CACHE_BYTES);
370 372
371 __direct_map_base = 0x80000000; 373 __direct_map_base = 0x80000000;
372 __direct_map_size = 0x80000000; 374 __direct_map_size = 0x80000000;
diff --git a/arch/alpha/kernel/core_t2.c b/arch/alpha/kernel/core_t2.c
index 2c00b61ca379..98d5b6ff8a76 100644
--- a/arch/alpha/kernel/core_t2.c
+++ b/arch/alpha/kernel/core_t2.c
@@ -351,7 +351,7 @@ t2_sg_map_window2(struct pci_controller *hose,
351 351
352 /* Note we can only do 1 SG window, as the other is for direct, so 352 /* Note we can only do 1 SG window, as the other is for direct, so
353 do an ISA SG area, especially for the floppy. */ 353 do an ISA SG area, especially for the floppy. */
354 hose->sg_isa = iommu_arena_new(hose, base, length, 0); 354 hose->sg_isa = iommu_arena_new(hose, base, length, SMP_CACHE_BYTES);
355 hose->sg_pci = NULL; 355 hose->sg_pci = NULL;
356 356
357 temp = (base & 0xfff00000UL) | ((base + length - 1) >> 20); 357 temp = (base & 0xfff00000UL) | ((base + length - 1) >> 20);
diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c
index 97551597581b..2a2820fb1be6 100644
--- a/arch/alpha/kernel/core_titan.c
+++ b/arch/alpha/kernel/core_titan.c
@@ -316,10 +316,12 @@ titan_init_one_pachip_port(titan_pachip_port *port, int index)
316 * Window 1 is direct access 1GB at 2GB 316 * Window 1 is direct access 1GB at 2GB
317 * Window 2 is scatter-gather 1GB at 3GB 317 * Window 2 is scatter-gather 1GB at 3GB
318 */ 318 */
319 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000, 0); 319 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000,
320 SMP_CACHE_BYTES);
320 hose->sg_isa->align_entry = 8; /* 64KB for ISA */ 321 hose->sg_isa->align_entry = 8; /* 64KB for ISA */
321 322
322 hose->sg_pci = iommu_arena_new(hose, 0xc0000000, 0x40000000, 0); 323 hose->sg_pci = iommu_arena_new(hose, 0xc0000000, 0x40000000,
324 SMP_CACHE_BYTES);
323 hose->sg_pci->align_entry = 4; /* Titan caches 4 PTEs at a time */ 325 hose->sg_pci->align_entry = 4; /* Titan caches 4 PTEs at a time */
324 326
325 port->wsba[0].csr = hose->sg_isa->dma_base | 3; 327 port->wsba[0].csr = hose->sg_isa->dma_base | 3;
diff --git a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsunami.c
index f334b8928d72..fc1ab73f23de 100644
--- a/arch/alpha/kernel/core_tsunami.c
+++ b/arch/alpha/kernel/core_tsunami.c
@@ -319,12 +319,14 @@ tsunami_init_one_pchip(tsunami_pchip *pchip, int index)
319 * NOTE: we need the align_entry settings for Acer devices on ES40, 319 * NOTE: we need the align_entry settings for Acer devices on ES40,
320 * specifically floppy and IDE when memory is larger than 2GB. 320 * specifically floppy and IDE when memory is larger than 2GB.
321 */ 321 */
322 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000, 0); 322 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000,
323 SMP_CACHE_BYTES);
323 /* Initially set for 4 PTEs, but will be overridden to 64K for ISA. */ 324 /* Initially set for 4 PTEs, but will be overridden to 64K for ISA. */
324 hose->sg_isa->align_entry = 4; 325 hose->sg_isa->align_entry = 4;
325 326
326 hose->sg_pci = iommu_arena_new(hose, 0x40000000, 327 hose->sg_pci = iommu_arena_new(hose, 0x40000000,
327 size_for_memory(0x40000000), 0); 328 size_for_memory(0x40000000),
329 SMP_CACHE_BYTES);
328 hose->sg_pci->align_entry = 4; /* Tsunami caches 4 PTEs at a time */ 330 hose->sg_pci->align_entry = 4; /* Tsunami caches 4 PTEs at a time */
329 331
330 __direct_map_base = 0x80000000; 332 __direct_map_base = 0x80000000;
diff --git a/arch/alpha/kernel/core_wildfire.c b/arch/alpha/kernel/core_wildfire.c
index cad36fc6ed7d..353c03d15442 100644
--- a/arch/alpha/kernel/core_wildfire.c
+++ b/arch/alpha/kernel/core_wildfire.c
@@ -111,8 +111,10 @@ wildfire_init_hose(int qbbno, int hoseno)
111 * ??? We ought to scale window 3 memory. 111 * ??? We ought to scale window 3 memory.
112 * 112 *
113 */ 113 */
114 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000, 0); 114 hose->sg_isa = iommu_arena_new(hose, 0x00800000, 0x00800000,
115 hose->sg_pci = iommu_arena_new(hose, 0xc0000000, 0x08000000, 0); 115 SMP_CACHE_BYTES);
116 hose->sg_pci = iommu_arena_new(hose, 0xc0000000, 0x08000000,
117 SMP_CACHE_BYTES);
116 118
117 pci = WILDFIRE_pci(qbbno, hoseno); 119 pci = WILDFIRE_pci(qbbno, hoseno);
118 120
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c
index a9378ee0c2f1..091cff3c68fd 100644
--- a/arch/alpha/kernel/pci-noop.c
+++ b/arch/alpha/kernel/pci-noop.c
@@ -33,7 +33,7 @@ alloc_pci_controller(void)
33{ 33{
34 struct pci_controller *hose; 34 struct pci_controller *hose;
35 35
36 hose = memblock_alloc(sizeof(*hose), 0); 36 hose = memblock_alloc(sizeof(*hose), SMP_CACHE_BYTES);
37 37
38 *hose_tail = hose; 38 *hose_tail = hose;
39 hose_tail = &hose->next; 39 hose_tail = &hose->next;
@@ -44,7 +44,7 @@ alloc_pci_controller(void)
44struct resource * __init 44struct resource * __init
45alloc_resource(void) 45alloc_resource(void)
46{ 46{
47 return memblock_alloc(sizeof(struct resource), 0); 47 return memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
48} 48}
49 49
50SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, bus, 50SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, bus,
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 13937e72d875..97098127df83 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -392,7 +392,7 @@ alloc_pci_controller(void)
392{ 392{
393 struct pci_controller *hose; 393 struct pci_controller *hose;
394 394
395 hose = memblock_alloc(sizeof(*hose), 0); 395 hose = memblock_alloc(sizeof(*hose), SMP_CACHE_BYTES);
396 396
397 *hose_tail = hose; 397 *hose_tail = hose;
398 hose_tail = &hose->next; 398 hose_tail = &hose->next;
@@ -403,7 +403,7 @@ alloc_pci_controller(void)
403struct resource * __init 403struct resource * __init
404alloc_resource(void) 404alloc_resource(void)
405{ 405{
406 return memblock_alloc(sizeof(struct resource), 0); 406 return memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
407} 407}
408 408
409 409
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c
index 82cf950bda2a..46e08e0d9181 100644
--- a/arch/alpha/kernel/pci_iommu.c
+++ b/arch/alpha/kernel/pci_iommu.c
@@ -79,7 +79,7 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,
79 printk("%s: couldn't allocate arena from node %d\n" 79 printk("%s: couldn't allocate arena from node %d\n"
80 " falling back to system-wide allocation\n", 80 " falling back to system-wide allocation\n",
81 __func__, nid); 81 __func__, nid);
82 arena = memblock_alloc(sizeof(*arena), 0); 82 arena = memblock_alloc(sizeof(*arena), SMP_CACHE_BYTES);
83 } 83 }
84 84
85 arena->ptes = memblock_alloc_node(sizeof(*arena), align, nid); 85 arena->ptes = memblock_alloc_node(sizeof(*arena), align, nid);
@@ -92,7 +92,7 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,
92 92
93#else /* CONFIG_DISCONTIGMEM */ 93#else /* CONFIG_DISCONTIGMEM */
94 94
95 arena = memblock_alloc(sizeof(*arena), 0); 95 arena = memblock_alloc(sizeof(*arena), SMP_CACHE_BYTES);
96 arena->ptes = memblock_alloc_from(mem_size, align, 0); 96 arena->ptes = memblock_alloc_from(mem_size, align, 0);
97 97
98#endif /* CONFIG_DISCONTIGMEM */ 98#endif /* CONFIG_DISCONTIGMEM */
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 840a4adc69fc..ac7e08886863 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -856,7 +856,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
856 */ 856 */
857 boot_alias_start = phys_to_idmap(start); 857 boot_alias_start = phys_to_idmap(start);
858 if (arm_has_idmap_alias() && boot_alias_start != IDMAP_INVALID_ADDR) { 858 if (arm_has_idmap_alias() && boot_alias_start != IDMAP_INVALID_ADDR) {
859 res = memblock_alloc(sizeof(*res), 0); 859 res = memblock_alloc(sizeof(*res), SMP_CACHE_BYTES);
860 res->name = "System RAM (boot alias)"; 860 res->name = "System RAM (boot alias)";
861 res->start = boot_alias_start; 861 res->start = boot_alias_start;
862 res->end = phys_to_idmap(end); 862 res->end = phys_to_idmap(end);
@@ -864,7 +864,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
864 request_resource(&iomem_resource, res); 864 request_resource(&iomem_resource, res);
865 } 865 }
866 866
867 res = memblock_alloc(sizeof(*res), 0); 867 res = memblock_alloc(sizeof(*res), SMP_CACHE_BYTES);
868 res->name = "System RAM"; 868 res->name = "System RAM";
869 res->start = start; 869 res->start = start;
870 res->end = end; 870 res->end = end;
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index cd5732ab0cdf..083dcd9942ce 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -726,7 +726,7 @@ static int __init _setup_clkctrl_provider(struct device_node *np)
726 u64 size; 726 u64 size;
727 int i; 727 int i;
728 728
729 provider = memblock_alloc(sizeof(*provider), 0); 729 provider = memblock_alloc(sizeof(*provider), SMP_CACHE_BYTES);
730 if (!provider) 730 if (!provider)
731 return -ENOMEM; 731 return -ENOMEM;
732 732
@@ -736,12 +736,14 @@ static int __init _setup_clkctrl_provider(struct device_node *np)
736 of_property_count_elems_of_size(np, "reg", sizeof(u32)) / 2; 736 of_property_count_elems_of_size(np, "reg", sizeof(u32)) / 2;
737 737
738 provider->addr = 738 provider->addr =
739 memblock_alloc(sizeof(void *) * provider->num_addrs, 0); 739 memblock_alloc(sizeof(void *) * provider->num_addrs,
740 SMP_CACHE_BYTES);
740 if (!provider->addr) 741 if (!provider->addr)
741 return -ENOMEM; 742 return -ENOMEM;
742 743
743 provider->size = 744 provider->size =
744 memblock_alloc(sizeof(u32) * provider->num_addrs, 0); 745 memblock_alloc(sizeof(u32) * provider->num_addrs,
746 SMP_CACHE_BYTES);
745 if (!provider->size) 747 if (!provider->size)
746 return -ENOMEM; 748 return -ENOMEM;
747 749
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 7ce7306f1d75..953e316521fc 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -218,7 +218,7 @@ static void __init request_standard_resources(void)
218 num_standard_resources = memblock.memory.cnt; 218 num_standard_resources = memblock.memory.cnt;
219 standard_resources = memblock_alloc_low(num_standard_resources * 219 standard_resources = memblock_alloc_low(num_standard_resources *
220 sizeof(*standard_resources), 220 sizeof(*standard_resources),
221 0); 221 SMP_CACHE_BYTES);
222 222
223 for_each_memblock(memory, region) { 223 for_each_memblock(memory, region) {
224 res = &standard_resources[i++]; 224 res = &standard_resources[i++];
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 9a6603f8e409..91bd1e129379 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -361,9 +361,9 @@ static ia64_state_log_t ia64_state_log[IA64_MAX_LOG_TYPES];
361 361
362#define IA64_LOG_ALLOCATE(it, size) \ 362#define IA64_LOG_ALLOCATE(it, size) \
363 {ia64_state_log[it].isl_log[IA64_LOG_CURR_INDEX(it)] = \ 363 {ia64_state_log[it].isl_log[IA64_LOG_CURR_INDEX(it)] = \
364 (ia64_err_rec_t *)memblock_alloc(size, 0); \ 364 (ia64_err_rec_t *)memblock_alloc(size, SMP_CACHE_BYTES); \
365 ia64_state_log[it].isl_log[IA64_LOG_NEXT_INDEX(it)] = \ 365 ia64_state_log[it].isl_log[IA64_LOG_NEXT_INDEX(it)] = \
366 (ia64_err_rec_t *)memblock_alloc(size, 0);} 366 (ia64_err_rec_t *)memblock_alloc(size, SMP_CACHE_BYTES);}
367#define IA64_LOG_LOCK_INIT(it) spin_lock_init(&ia64_state_log[it].isl_lock) 367#define IA64_LOG_LOCK_INIT(it) spin_lock_init(&ia64_state_log[it].isl_lock)
368#define IA64_LOG_LOCK(it) spin_lock_irqsave(&ia64_state_log[it].isl_lock, s) 368#define IA64_LOG_LOCK(it) spin_lock_irqsave(&ia64_state_log[it].isl_lock, s)
369#define IA64_LOG_UNLOCK(it) spin_unlock_irqrestore(&ia64_state_log[it].isl_lock,s) 369#define IA64_LOG_UNLOCK(it) spin_unlock_irqrestore(&ia64_state_log[it].isl_lock,s)
diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c
index ab545daff7c3..9340bcb4f29c 100644
--- a/arch/ia64/mm/tlb.c
+++ b/arch/ia64/mm/tlb.c
@@ -59,8 +59,10 @@ struct ia64_tr_entry *ia64_idtrs[NR_CPUS];
59void __init 59void __init
60mmu_context_init (void) 60mmu_context_init (void)
61{ 61{
62 ia64_ctx.bitmap = memblock_alloc((ia64_ctx.max_ctx + 1) >> 3, 0); 62 ia64_ctx.bitmap = memblock_alloc((ia64_ctx.max_ctx + 1) >> 3,
63 ia64_ctx.flushmap = memblock_alloc((ia64_ctx.max_ctx + 1) >> 3, 0); 63 SMP_CACHE_BYTES);
64 ia64_ctx.flushmap = memblock_alloc((ia64_ctx.max_ctx + 1) >> 3,
65 SMP_CACHE_BYTES);
64} 66}
65 67
66/* 68/*
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index 98f55220c67d..8df13d0d96fa 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -391,7 +391,9 @@ void __init hubdev_init_node(nodepda_t * npda, cnodeid_t node)
391 if (node >= num_online_nodes()) /* Headless/memless IO nodes */ 391 if (node >= num_online_nodes()) /* Headless/memless IO nodes */
392 node = 0; 392 node = 0;
393 393
394 hubdev_info = (struct hubdev_info *)memblock_alloc_node(size, 0, node); 394 hubdev_info = (struct hubdev_info *)memblock_alloc_node(size,
395 SMP_CACHE_BYTES,
396 node);
395 397
396 npda->pdinfo = (void *)hubdev_info; 398 npda->pdinfo = (void *)hubdev_info;
397} 399}
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 71ad6b0ccab4..a6d40a2c5bff 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -511,7 +511,8 @@ static void __init sn_init_pdas(char **cmdline_p)
511 */ 511 */
512 for_each_online_node(cnode) { 512 for_each_online_node(cnode) {
513 nodepdaindr[cnode] = 513 nodepdaindr[cnode] =
514 memblock_alloc_node(sizeof(nodepda_t), 0, cnode); 514 memblock_alloc_node(sizeof(nodepda_t), SMP_CACHE_BYTES,
515 cnode);
515 memset(nodepdaindr[cnode]->phys_cpuid, -1, 516 memset(nodepdaindr[cnode]->phys_cpuid, -1,
516 sizeof(nodepdaindr[cnode]->phys_cpuid)); 517 sizeof(nodepdaindr[cnode]->phys_cpuid));
517 spin_lock_init(&nodepdaindr[cnode]->ptc_lock); 518 spin_lock_init(&nodepdaindr[cnode]->ptc_lock);
@@ -522,7 +523,7 @@ static void __init sn_init_pdas(char **cmdline_p)
522 */ 523 */
523 for (cnode = num_online_nodes(); cnode < num_cnodes; cnode++) 524 for (cnode = num_online_nodes(); cnode < num_cnodes; cnode++)
524 nodepdaindr[cnode] = 525 nodepdaindr[cnode] =
525 memblock_alloc_node(sizeof(nodepda_t), 0, 0); 526 memblock_alloc_node(sizeof(nodepda_t), SMP_CACHE_BYTES, 0);
526 527
527 /* 528 /*
528 * Now copy the array of nodepda pointers to each nodepda. 529 * Now copy the array of nodepda pointers to each nodepda.
diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index 8be8b750c629..4d64711d3d47 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -268,7 +268,7 @@ void __init dvma_init(void)
268 list_add(&(hole->list), &hole_list); 268 list_add(&(hole->list), &hole_list);
269 269
270 iommu_use = memblock_alloc(IOMMU_TOTAL_ENTRIES * sizeof(unsigned long), 270 iommu_use = memblock_alloc(IOMMU_TOTAL_ENTRIES * sizeof(unsigned long),
271 0); 271 SMP_CACHE_BYTES);
272 272
273 dvma_unmap_iommu(DVMA_START, DVMA_SIZE); 273 dvma_unmap_iommu(DVMA_START, DVMA_SIZE);
274 274
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index 8c14988f52f2..b17fd8aafd64 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -376,7 +376,7 @@ void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
376 if (mem_init_done) 376 if (mem_init_done)
377 p = kzalloc(size, mask); 377 p = kzalloc(size, mask);
378 else { 378 else {
379 p = memblock_alloc(size, 0); 379 p = memblock_alloc(size, SMP_CACHE_BYTES);
380 if (p) 380 if (p)
381 memset(p, 0, size); 381 memset(p, 0, size);
382 } 382 }
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 41c1683761bb..ea09ed6a80a9 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -916,7 +916,7 @@ static void __init resource_init(void)
916 if (end >= HIGHMEM_START) 916 if (end >= HIGHMEM_START)
917 end = HIGHMEM_START - 1; 917 end = HIGHMEM_START - 1;
918 918
919 res = memblock_alloc(sizeof(struct resource), 0); 919 res = memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
920 920
921 res->start = start; 921 res->start = start;
922 res->end = end; 922 res->end = end;
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index f331a0054b3a..913bfca09c4f 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -198,7 +198,7 @@ void __init allocate_paca_ptrs(void)
198 paca_nr_cpu_ids = nr_cpu_ids; 198 paca_nr_cpu_ids = nr_cpu_ids;
199 199
200 paca_ptrs_size = sizeof(struct paca_struct *) * nr_cpu_ids; 200 paca_ptrs_size = sizeof(struct paca_struct *) * nr_cpu_ids;
201 paca_ptrs = __va(memblock_phys_alloc(paca_ptrs_size, 0)); 201 paca_ptrs = __va(memblock_phys_alloc(paca_ptrs_size, SMP_CACHE_BYTES));
202 memset(paca_ptrs, 0x88, paca_ptrs_size); 202 memset(paca_ptrs, 0x88, paca_ptrs_size);
203} 203}
204 204
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 274bd1442dd9..d3f04f2d8249 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -203,7 +203,8 @@ pci_create_OF_bus_map(void)
203 struct property* of_prop; 203 struct property* of_prop;
204 struct device_node *dn; 204 struct device_node *dn;
205 205
206 of_prop = memblock_alloc(sizeof(struct property) + 256, 0); 206 of_prop = memblock_alloc(sizeof(struct property) + 256,
207 SMP_CACHE_BYTES);
207 dn = of_find_node_by_path("/"); 208 dn = of_find_node_by_path("/");
208 if (dn) { 209 if (dn) {
209 memset(of_prop, -1, sizeof(struct property) + 256); 210 memset(of_prop, -1, sizeof(struct property) + 256);
diff --git a/arch/powerpc/lib/alloc.c b/arch/powerpc/lib/alloc.c
index 5b61704447c1..dedf88a76f58 100644
--- a/arch/powerpc/lib/alloc.c
+++ b/arch/powerpc/lib/alloc.c
@@ -14,7 +14,7 @@ void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
14 if (slab_is_available()) 14 if (slab_is_available())
15 p = kzalloc(size, mask); 15 p = kzalloc(size, mask);
16 else { 16 else {
17 p = memblock_alloc(size, 0); 17 p = memblock_alloc(size, SMP_CACHE_BYTES);
18 } 18 }
19 return p; 19 return p;
20} 20}
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index 67b9d7b669a1..2faca46ad720 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -461,10 +461,11 @@ void __init mmu_context_init(void)
461 /* 461 /*
462 * Allocate the maps used by context management 462 * Allocate the maps used by context management
463 */ 463 */
464 context_map = memblock_alloc(CTX_MAP_SIZE, 0); 464 context_map = memblock_alloc(CTX_MAP_SIZE, SMP_CACHE_BYTES);
465 context_mm = memblock_alloc(sizeof(void *) * (LAST_CONTEXT + 1), 0); 465 context_mm = memblock_alloc(sizeof(void *) * (LAST_CONTEXT + 1),
466 SMP_CACHE_BYTES);
466#ifdef CONFIG_SMP 467#ifdef CONFIG_SMP
467 stale_map[boot_cpuid] = memblock_alloc(CTX_MAP_SIZE, 0); 468 stale_map[boot_cpuid] = memblock_alloc(CTX_MAP_SIZE, SMP_CACHE_BYTES);
468 469
469 cpuhp_setup_state_nocalls(CPUHP_POWERPC_MMU_CTX_PREPARE, 470 cpuhp_setup_state_nocalls(CPUHP_POWERPC_MMU_CTX_PREPARE,
470 "powerpc/mmu/ctx:prepare", 471 "powerpc/mmu/ctx:prepare",
diff --git a/arch/powerpc/platforms/powermac/nvram.c b/arch/powerpc/platforms/powermac/nvram.c
index f3391be7c762..ae54d7fe68f3 100644
--- a/arch/powerpc/platforms/powermac/nvram.c
+++ b/arch/powerpc/platforms/powermac/nvram.c
@@ -513,7 +513,7 @@ static int __init core99_nvram_setup(struct device_node *dp, unsigned long addr)
513 printk(KERN_ERR "nvram: no address\n"); 513 printk(KERN_ERR "nvram: no address\n");
514 return -EINVAL; 514 return -EINVAL;
515 } 515 }
516 nvram_image = memblock_alloc(NVRAM_SIZE, 0); 516 nvram_image = memblock_alloc(NVRAM_SIZE, SMP_CACHE_BYTES);
517 nvram_data = ioremap(addr, NVRAM_SIZE*2); 517 nvram_data = ioremap(addr, NVRAM_SIZE*2);
518 nvram_naddrs = 1; /* Make sure we get the correct case */ 518 nvram_naddrs = 1; /* Make sure we get the correct case */
519 519
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index aba81cbf0b36..dd807446801e 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -3769,7 +3769,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
3769 phb_id = be64_to_cpup(prop64); 3769 phb_id = be64_to_cpup(prop64);
3770 pr_debug(" PHB-ID : 0x%016llx\n", phb_id); 3770 pr_debug(" PHB-ID : 0x%016llx\n", phb_id);
3771 3771
3772 phb = memblock_alloc(sizeof(*phb), 0); 3772 phb = memblock_alloc(sizeof(*phb), SMP_CACHE_BYTES);
3773 3773
3774 /* Allocate PCI controller */ 3774 /* Allocate PCI controller */
3775 phb->hose = hose = pcibios_alloc_controller(np); 3775 phb->hose = hose = pcibios_alloc_controller(np);
@@ -3815,7 +3815,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
3815 else 3815 else
3816 phb->diag_data_size = PNV_PCI_DIAG_BUF_SIZE; 3816 phb->diag_data_size = PNV_PCI_DIAG_BUF_SIZE;
3817 3817
3818 phb->diag_data = memblock_alloc(phb->diag_data_size, 0); 3818 phb->diag_data = memblock_alloc(phb->diag_data_size, SMP_CACHE_BYTES);
3819 3819
3820 /* Parse 32-bit and IO ranges (if any) */ 3820 /* Parse 32-bit and IO ranges (if any) */
3821 pci_process_bridge_OF_ranges(hose, np, !hose->global_number); 3821 pci_process_bridge_OF_ranges(hose, np, !hose->global_number);
@@ -3874,7 +3874,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
3874 } 3874 }
3875 pemap_off = size; 3875 pemap_off = size;
3876 size += phb->ioda.total_pe_num * sizeof(struct pnv_ioda_pe); 3876 size += phb->ioda.total_pe_num * sizeof(struct pnv_ioda_pe);
3877 aux = memblock_alloc(size, 0); 3877 aux = memblock_alloc(size, SMP_CACHE_BYTES);
3878 phb->ioda.pe_alloc = aux; 3878 phb->ioda.pe_alloc = aux;
3879 phb->ioda.m64_segmap = aux + m64map_off; 3879 phb->ioda.m64_segmap = aux + m64map_off;
3880 phb->ioda.m32_segmap = aux + m32map_off; 3880 phb->ioda.m32_segmap = aux + m32map_off;
diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c
index 2444feda831f..d45450f6666a 100644
--- a/arch/powerpc/sysdev/msi_bitmap.c
+++ b/arch/powerpc/sysdev/msi_bitmap.c
@@ -128,7 +128,7 @@ int __ref msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
128 if (bmp->bitmap_from_slab) 128 if (bmp->bitmap_from_slab)
129 bmp->bitmap = kzalloc(size, GFP_KERNEL); 129 bmp->bitmap = kzalloc(size, GFP_KERNEL);
130 else { 130 else {
131 bmp->bitmap = memblock_alloc(size, 0); 131 bmp->bitmap = memblock_alloc(size, SMP_CACHE_BYTES);
132 /* the bitmap won't be freed from memblock allocator */ 132 /* the bitmap won't be freed from memblock allocator */
133 kmemleak_not_leak(bmp->bitmap); 133 kmemleak_not_leak(bmp->bitmap);
134 } 134 }
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 673816880cce..624cb47cc9cd 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -650,7 +650,7 @@ static int __init eth_setup(char *str)
650 return 1; 650 return 1;
651 } 651 }
652 652
653 new = memblock_alloc(sizeof(*new), 0); 653 new = memblock_alloc(sizeof(*new), SMP_CACHE_BYTES);
654 654
655 INIT_LIST_HEAD(&new->list); 655 INIT_LIST_HEAD(&new->list);
656 new->index = n; 656 new->index = n;
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 2b4dded11a7a..10d8d20eb9ec 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1580,7 +1580,7 @@ static int __init vector_setup(char *str)
1580 str, error); 1580 str, error);
1581 return 1; 1581 return 1;
1582 } 1582 }
1583 new = memblock_alloc(sizeof(*new), 0); 1583 new = memblock_alloc(sizeof(*new), SMP_CACHE_BYTES);
1584 INIT_LIST_HEAD(&new->list); 1584 INIT_LIST_HEAD(&new->list);
1585 new->unit = n; 1585 new->unit = n;
1586 new->arguments = str; 1586 new->arguments = str;
diff --git a/arch/um/kernel/initrd.c b/arch/um/kernel/initrd.c
index 3678f5b05e42..ce169ea87e61 100644
--- a/arch/um/kernel/initrd.c
+++ b/arch/um/kernel/initrd.c
@@ -36,7 +36,7 @@ int __init read_initrd(void)
36 return 0; 36 return 0;
37 } 37 }
38 38
39 area = memblock_alloc(size, 0); 39 area = memblock_alloc(size, SMP_CACHE_BYTES);
40 40
41 if (load_initrd(initrd, area, size) == -1) 41 if (load_initrd(initrd, area, size) == -1)
42 return 0; 42 return 0;
diff --git a/arch/unicore32/kernel/setup.c b/arch/unicore32/kernel/setup.c
index b2c38b32ea57..4b0cb68c355a 100644
--- a/arch/unicore32/kernel/setup.c
+++ b/arch/unicore32/kernel/setup.c
@@ -206,7 +206,7 @@ request_standard_resources(struct meminfo *mi)
206 if (mi->bank[i].size == 0) 206 if (mi->bank[i].size == 0)
207 continue; 207 continue;
208 208
209 res = memblock_alloc_low(sizeof(*res), 0); 209 res = memblock_alloc_low(sizeof(*res), SMP_CACHE_BYTES);
210 res->name = "System RAM"; 210 res->name = "System RAM";
211 res->start = mi->bank[i].start; 211 res->start = mi->bank[i].start;
212 res->end = mi->bank[i].start + mi->bank[i].size - 1; 212 res->end = mi->bank[i].start + mi->bank[i].size - 1;
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 7f5d212551d4..92c76bf97ad8 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -934,7 +934,7 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
934 */ 934 */
935#define HPET_RESOURCE_NAME_SIZE 9 935#define HPET_RESOURCE_NAME_SIZE 9
936 hpet_res = memblock_alloc(sizeof(*hpet_res) + HPET_RESOURCE_NAME_SIZE, 936 hpet_res = memblock_alloc(sizeof(*hpet_res) + HPET_RESOURCE_NAME_SIZE,
937 0); 937 SMP_CACHE_BYTES);
938 938
939 hpet_res->name = (void *)&hpet_res[1]; 939 hpet_res->name = (void *)&hpet_res[1];
940 hpet_res->flags = IORESOURCE_MEM; 940 hpet_res->flags = IORESOURCE_MEM;
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 5fbc57e4b0b9..2953bbf05c08 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2578,7 +2578,7 @@ static struct resource * __init ioapic_setup_resources(void)
2578 n = IOAPIC_RESOURCE_NAME_SIZE + sizeof(struct resource); 2578 n = IOAPIC_RESOURCE_NAME_SIZE + sizeof(struct resource);
2579 n *= nr_ioapics; 2579 n *= nr_ioapics;
2580 2580
2581 mem = memblock_alloc(n, 0); 2581 mem = memblock_alloc(n, SMP_CACHE_BYTES);
2582 res = (void *)mem; 2582 res = (void *)mem;
2583 2583
2584 mem += sizeof(struct resource) * nr_ioapics; 2584 mem += sizeof(struct resource) * nr_ioapics;
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 68ff62bffbab..50895c2f937d 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1093,7 +1093,8 @@ void __init e820__reserve_resources(void)
1093 struct resource *res; 1093 struct resource *res;
1094 u64 end; 1094 u64 end;
1095 1095
1096 res = memblock_alloc(sizeof(*res) * e820_table->nr_entries, 0); 1096 res = memblock_alloc(sizeof(*res) * e820_table->nr_entries,
1097 SMP_CACHE_BYTES);
1097 e820_res = res; 1098 e820_res = res;
1098 1099
1099 for (i = 0; i < e820_table->nr_entries; i++) { 1100 for (i = 0; i < e820_table->nr_entries; i++) {
diff --git a/arch/x86/platform/olpc/olpc_dt.c b/arch/x86/platform/olpc/olpc_dt.c
index 115c8e4173bb..24d2175a9480 100644
--- a/arch/x86/platform/olpc/olpc_dt.c
+++ b/arch/x86/platform/olpc/olpc_dt.c
@@ -141,7 +141,7 @@ void * __init prom_early_alloc(unsigned long size)
141 * fast enough on the platforms we care about while minimizing 141 * fast enough on the platforms we care about while minimizing
142 * wasted bootmem) and hand off chunks of it to callers. 142 * wasted bootmem) and hand off chunks of it to callers.
143 */ 143 */
144 res = memblock_alloc(chunk_size, 0); 144 res = memblock_alloc(chunk_size, SMP_CACHE_BYTES);
145 BUG_ON(!res); 145 BUG_ON(!res);
146 prom_early_allocated += chunk_size; 146 prom_early_allocated += chunk_size;
147 memset(res, 0, chunk_size); 147 memset(res, 0, chunk_size);
diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c
index 190846dddc67..d052712373b6 100644
--- a/arch/xtensa/platforms/iss/network.c
+++ b/arch/xtensa/platforms/iss/network.c
@@ -646,7 +646,7 @@ static int __init iss_net_setup(char *str)
646 return 1; 646 return 1;
647 } 647 }
648 648
649 new = memblock_alloc(sizeof(*new), 0); 649 new = memblock_alloc(sizeof(*new), SMP_CACHE_BYTES);
650 if (new == NULL) { 650 if (new == NULL) {
651 pr_err("Alloc_bootmem failed\n"); 651 pr_err("Alloc_bootmem failed\n");
652 return 1; 652 return 1;
diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c
index 5b2867a33b98..e205af814582 100644
--- a/drivers/clk/ti/clk.c
+++ b/drivers/clk/ti/clk.c
@@ -342,7 +342,7 @@ void __init omap2_clk_legacy_provider_init(int index, void __iomem *mem)
342{ 342{
343 struct clk_iomap *io; 343 struct clk_iomap *io;
344 344
345 io = memblock_alloc(sizeof(*io), 0); 345 io = memblock_alloc(sizeof(*io), SMP_CACHE_BYTES);
346 346
347 io->mem = mem; 347 io->mem = mem;
348 348
diff --git a/drivers/firmware/efi/memmap.c b/drivers/firmware/efi/memmap.c
index ef618bceb79a..fa2904fb841f 100644
--- a/drivers/firmware/efi/memmap.c
+++ b/drivers/firmware/efi/memmap.c
@@ -15,7 +15,7 @@
15 15
16static phys_addr_t __init __efi_memmap_alloc_early(unsigned long size) 16static phys_addr_t __init __efi_memmap_alloc_early(unsigned long size)
17{ 17{
18 return memblock_phys_alloc(size, 0); 18 return memblock_phys_alloc(size, SMP_CACHE_BYTES);
19} 19}
20 20
21static phys_addr_t __init __efi_memmap_alloc_late(unsigned long size) 21static phys_addr_t __init __efi_memmap_alloc_late(unsigned long size)
diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c
index 2a23453f005a..d168c87c7d30 100644
--- a/drivers/firmware/memmap.c
+++ b/drivers/firmware/memmap.c
@@ -333,7 +333,8 @@ int __init firmware_map_add_early(u64 start, u64 end, const char *type)
333{ 333{
334 struct firmware_map_entry *entry; 334 struct firmware_map_entry *entry;
335 335
336 entry = memblock_alloc(sizeof(struct firmware_map_entry), 0); 336 entry = memblock_alloc(sizeof(struct firmware_map_entry),
337 SMP_CACHE_BYTES);
337 if (WARN_ON(!entry)) 338 if (WARN_ON(!entry))
338 return -ENOMEM; 339 return -ENOMEM;
339 340
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 880a81c82b7a..0a0b8e1f4236 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -492,7 +492,7 @@ int __init smu_init (void)
492 goto fail_np; 492 goto fail_np;
493 } 493 }
494 494
495 smu = memblock_alloc(sizeof(struct smu_device), 0); 495 smu = memblock_alloc(sizeof(struct smu_device), SMP_CACHE_BYTES);
496 496
497 spin_lock_init(&smu->lock); 497 spin_lock_init(&smu->lock);
498 INIT_LIST_HEAD(&smu->cmd_list); 498 INIT_LIST_HEAD(&smu->cmd_list);
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index d6255c276a41..1977ee0adcb1 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -36,6 +36,7 @@ int __init __weak early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
36 * panic()s on allocation failure. 36 * panic()s on allocation failure.
37 */ 37 */
38 end = !end ? MEMBLOCK_ALLOC_ANYWHERE : end; 38 end = !end ? MEMBLOCK_ALLOC_ANYWHERE : end;
39 align = !align ? SMP_CACHE_BYTES : align;
39 base = __memblock_alloc_base(size, align, end); 40 base = __memblock_alloc_base(size, align, end);
40 if (!base) 41 if (!base)
41 return -ENOMEM; 42 return -ENOMEM;
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 1b4d85879cbe..aee299a6aa76 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -406,7 +406,8 @@ static inline void * __init memblock_alloc_node(phys_addr_t size,
406static inline void * __init memblock_alloc_node_nopanic(phys_addr_t size, 406static inline void * __init memblock_alloc_node_nopanic(phys_addr_t size,
407 int nid) 407 int nid)
408{ 408{
409 return memblock_alloc_try_nid_nopanic(size, 0, MEMBLOCK_LOW_LIMIT, 409 return memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES,
410 MEMBLOCK_LOW_LIMIT,
410 MEMBLOCK_ALLOC_ACCESSIBLE, nid); 411 MEMBLOCK_ALLOC_ACCESSIBLE, nid);
411} 412}
412 413
diff --git a/init/main.c b/init/main.c
index 51b8e7b8ae5b..ee147103ba1b 100644
--- a/init/main.c
+++ b/init/main.c
@@ -375,10 +375,11 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { }
375static void __init setup_command_line(char *command_line) 375static void __init setup_command_line(char *command_line)
376{ 376{
377 saved_command_line = 377 saved_command_line =
378 memblock_alloc(strlen(boot_command_line) + 1, 0); 378 memblock_alloc(strlen(boot_command_line) + 1, SMP_CACHE_BYTES);
379 initcall_command_line = 379 initcall_command_line =
380 memblock_alloc(strlen(boot_command_line) + 1, 0); 380 memblock_alloc(strlen(boot_command_line) + 1, SMP_CACHE_BYTES);
381 static_command_line = memblock_alloc(strlen(command_line) + 1, 0); 381 static_command_line = memblock_alloc(strlen(command_line) + 1,
382 SMP_CACHE_BYTES);
382 strcpy(saved_command_line, boot_command_line); 383 strcpy(saved_command_line, boot_command_line);
383 strcpy(static_command_line, command_line); 384 strcpy(static_command_line, command_line);
384} 385}
@@ -773,8 +774,10 @@ static int __init initcall_blacklist(char *str)
773 str_entry = strsep(&str, ","); 774 str_entry = strsep(&str, ",");
774 if (str_entry) { 775 if (str_entry) {
775 pr_debug("blacklisting initcall %s\n", str_entry); 776 pr_debug("blacklisting initcall %s\n", str_entry);
776 entry = memblock_alloc(sizeof(*entry), 0); 777 entry = memblock_alloc(sizeof(*entry),
777 entry->buf = memblock_alloc(strlen(str_entry) + 1, 0); 778 SMP_CACHE_BYTES);
779 entry->buf = memblock_alloc(strlen(str_entry) + 1,
780 SMP_CACHE_BYTES);
778 strcpy(entry->buf, str_entry); 781 strcpy(entry->buf, str_entry);
779 list_add(&entry->next, &blacklisted_initcalls); 782 list_add(&entry->next, &blacklisted_initcalls);
780 } 783 }
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 3c9e365438ad..b0308a2c6000 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -963,7 +963,8 @@ void __init __register_nosave_region(unsigned long start_pfn,
963 BUG_ON(!region); 963 BUG_ON(!region);
964 } else { 964 } else {
965 /* This allocation cannot fail */ 965 /* This allocation cannot fail */
966 region = memblock_alloc(sizeof(struct nosave_region), 0); 966 region = memblock_alloc(sizeof(struct nosave_region),
967 SMP_CACHE_BYTES);
967 } 968 }
968 region->start_pfn = start_pfn; 969 region->start_pfn = start_pfn;
969 region->end_pfn = end_pfn; 970 region->end_pfn = end_pfn;
diff --git a/lib/cpumask.c b/lib/cpumask.c
index 75b5e7672c4c..8d666ab84b5c 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -163,7 +163,7 @@ EXPORT_SYMBOL(zalloc_cpumask_var);
163 */ 163 */
164void __init alloc_bootmem_cpumask_var(cpumask_var_t *mask) 164void __init alloc_bootmem_cpumask_var(cpumask_var_t *mask)
165{ 165{
166 *mask = memblock_alloc(cpumask_size(), 0); 166 *mask = memblock_alloc(cpumask_size(), SMP_CACHE_BYTES);
167} 167}
168 168
169/** 169/**
diff --git a/mm/memblock.c b/mm/memblock.c
index c655342569f8..839531133816 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1247,9 +1247,6 @@ static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size,
1247{ 1247{
1248 phys_addr_t found; 1248 phys_addr_t found;
1249 1249
1250 if (!align)
1251 align = SMP_CACHE_BYTES;
1252
1253 found = memblock_find_in_range_node(size, align, start, end, nid, 1250 found = memblock_find_in_range_node(size, align, start, end, nid,
1254 flags); 1251 flags);
1255 if (found && !memblock_reserve(found, size)) { 1252 if (found && !memblock_reserve(found, size)) {
@@ -1343,8 +1340,6 @@ phys_addr_t __init memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t ali
1343 * The allocation is performed from memory region limited by 1340 * The allocation is performed from memory region limited by
1344 * memblock.current_limit if @max_addr == %MEMBLOCK_ALLOC_ACCESSIBLE. 1341 * memblock.current_limit if @max_addr == %MEMBLOCK_ALLOC_ACCESSIBLE.
1345 * 1342 *
1346 * The memory block is aligned on %SMP_CACHE_BYTES if @align == 0.
1347 *
1348 * The phys address of allocated boot memory block is converted to virtual and 1343 * The phys address of allocated boot memory block is converted to virtual and
1349 * allocated memory is reset to 0. 1344 * allocated memory is reset to 0.
1350 * 1345 *
@@ -1374,9 +1369,6 @@ static void * __init memblock_alloc_internal(
1374 if (WARN_ON_ONCE(slab_is_available())) 1369 if (WARN_ON_ONCE(slab_is_available()))
1375 return kzalloc_node(size, GFP_NOWAIT, nid); 1370 return kzalloc_node(size, GFP_NOWAIT, nid);
1376 1371
1377 if (!align)
1378 align = SMP_CACHE_BYTES;
1379
1380 if (max_addr > memblock.current_limit) 1372 if (max_addr > memblock.current_limit)
1381 max_addr = memblock.current_limit; 1373 max_addr = memblock.current_limit;
1382again: 1374again:
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ef289fadec0e..a919ba5cb3c8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7710,9 +7710,11 @@ void *__init alloc_large_system_hash(const char *tablename,
7710 size = bucketsize << log2qty; 7710 size = bucketsize << log2qty;
7711 if (flags & HASH_EARLY) { 7711 if (flags & HASH_EARLY) {
7712 if (flags & HASH_ZERO) 7712 if (flags & HASH_ZERO)
7713 table = memblock_alloc_nopanic(size, 0); 7713 table = memblock_alloc_nopanic(size,
7714 SMP_CACHE_BYTES);
7714 else 7715 else
7715 table = memblock_alloc_raw(size, 0); 7716 table = memblock_alloc_raw(size,
7717 SMP_CACHE_BYTES);
7716 } else if (hashdist) { 7718 } else if (hashdist) {
7717 table = __vmalloc(size, gfp_flags, PAGE_KERNEL); 7719 table = __vmalloc(size, gfp_flags, PAGE_KERNEL);
7718 } else { 7720 } else {
diff --git a/mm/percpu.c b/mm/percpu.c
index 61cdbb3b3736..a6b74c6fe0be 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1102,8 +1102,8 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr,
1102 1102
1103 /* allocate chunk */ 1103 /* allocate chunk */
1104 chunk = memblock_alloc(sizeof(struct pcpu_chunk) + 1104 chunk = memblock_alloc(sizeof(struct pcpu_chunk) +
1105 BITS_TO_LONGS(region_size >> PAGE_SHIFT), 1105 BITS_TO_LONGS(region_size >> PAGE_SHIFT),
1106 0); 1106 SMP_CACHE_BYTES);
1107 1107
1108 INIT_LIST_HEAD(&chunk->list); 1108 INIT_LIST_HEAD(&chunk->list);
1109 1109
@@ -1114,12 +1114,12 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr,
1114 chunk->nr_pages = region_size >> PAGE_SHIFT; 1114 chunk->nr_pages = region_size >> PAGE_SHIFT;
1115 region_bits = pcpu_chunk_map_bits(chunk); 1115 region_bits = pcpu_chunk_map_bits(chunk);
1116 1116
1117 chunk->alloc_map = memblock_alloc(BITS_TO_LONGS(region_bits) * 1117 chunk->alloc_map = memblock_alloc(BITS_TO_LONGS(region_bits) * sizeof(chunk->alloc_map[0]),
1118 sizeof(chunk->alloc_map[0]), 0); 1118 SMP_CACHE_BYTES);
1119 chunk->bound_map = memblock_alloc(BITS_TO_LONGS(region_bits + 1) * 1119 chunk->bound_map = memblock_alloc(BITS_TO_LONGS(region_bits + 1) * sizeof(chunk->bound_map[0]),
1120 sizeof(chunk->bound_map[0]), 0); 1120 SMP_CACHE_BYTES);
1121 chunk->md_blocks = memblock_alloc(pcpu_chunk_nr_blocks(chunk) * 1121 chunk->md_blocks = memblock_alloc(pcpu_chunk_nr_blocks(chunk) * sizeof(chunk->md_blocks[0]),
1122 sizeof(chunk->md_blocks[0]), 0); 1122 SMP_CACHE_BYTES);
1123 pcpu_init_md_blocks(chunk); 1123 pcpu_init_md_blocks(chunk);
1124 1124
1125 /* manage populated page bitmap */ 1125 /* manage populated page bitmap */
@@ -2075,12 +2075,14 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
2075 PCPU_SETUP_BUG_ON(pcpu_verify_alloc_info(ai) < 0); 2075 PCPU_SETUP_BUG_ON(pcpu_verify_alloc_info(ai) < 0);
2076 2076
2077 /* process group information and build config tables accordingly */ 2077 /* process group information and build config tables accordingly */
2078 group_offsets = memblock_alloc(ai->nr_groups * 2078 group_offsets = memblock_alloc(ai->nr_groups * sizeof(group_offsets[0]),
2079 sizeof(group_offsets[0]), 0); 2079 SMP_CACHE_BYTES);
2080 group_sizes = memblock_alloc(ai->nr_groups * 2080 group_sizes = memblock_alloc(ai->nr_groups * sizeof(group_sizes[0]),
2081 sizeof(group_sizes[0]), 0); 2081 SMP_CACHE_BYTES);
2082 unit_map = memblock_alloc(nr_cpu_ids * sizeof(unit_map[0]), 0); 2082 unit_map = memblock_alloc(nr_cpu_ids * sizeof(unit_map[0]),
2083 unit_off = memblock_alloc(nr_cpu_ids * sizeof(unit_off[0]), 0); 2083 SMP_CACHE_BYTES);
2084 unit_off = memblock_alloc(nr_cpu_ids * sizeof(unit_off[0]),
2085 SMP_CACHE_BYTES);
2084 2086
2085 for (cpu = 0; cpu < nr_cpu_ids; cpu++) 2087 for (cpu = 0; cpu < nr_cpu_ids; cpu++)
2086 unit_map[cpu] = UINT_MAX; 2088 unit_map[cpu] = UINT_MAX;
@@ -2144,8 +2146,8 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
2144 * empty chunks. 2146 * empty chunks.
2145 */ 2147 */
2146 pcpu_nr_slots = __pcpu_size_to_slot(pcpu_unit_size) + 2; 2148 pcpu_nr_slots = __pcpu_size_to_slot(pcpu_unit_size) + 2;
2147 pcpu_slot = memblock_alloc( 2149 pcpu_slot = memblock_alloc(pcpu_nr_slots * sizeof(pcpu_slot[0]),
2148 pcpu_nr_slots * sizeof(pcpu_slot[0]), 0); 2150 SMP_CACHE_BYTES);
2149 for (i = 0; i < pcpu_nr_slots; i++) 2151 for (i = 0; i < pcpu_nr_slots; i++)
2150 INIT_LIST_HEAD(&pcpu_slot[i]); 2152 INIT_LIST_HEAD(&pcpu_slot[i]);
2151 2153
@@ -2458,7 +2460,7 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
2458 size_sum = ai->static_size + ai->reserved_size + ai->dyn_size; 2460 size_sum = ai->static_size + ai->reserved_size + ai->dyn_size;
2459 areas_size = PFN_ALIGN(ai->nr_groups * sizeof(void *)); 2461 areas_size = PFN_ALIGN(ai->nr_groups * sizeof(void *));
2460 2462
2461 areas = memblock_alloc_nopanic(areas_size, 0); 2463 areas = memblock_alloc_nopanic(areas_size, SMP_CACHE_BYTES);
2462 if (!areas) { 2464 if (!areas) {
2463 rc = -ENOMEM; 2465 rc = -ENOMEM;
2464 goto out_free; 2466 goto out_free;
@@ -2599,7 +2601,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,
2599 /* unaligned allocations can't be freed, round up to page size */ 2601 /* unaligned allocations can't be freed, round up to page size */
2600 pages_size = PFN_ALIGN(unit_pages * num_possible_cpus() * 2602 pages_size = PFN_ALIGN(unit_pages * num_possible_cpus() *
2601 sizeof(pages[0])); 2603 sizeof(pages[0]));
2602 pages = memblock_alloc(pages_size, 0); 2604 pages = memblock_alloc(pages_size, SMP_CACHE_BYTES);
2603 2605
2604 /* allocate pages */ 2606 /* allocate pages */
2605 j = 0; 2607 j = 0;
diff --git a/mm/sparse.c b/mm/sparse.c
index ab2ac45e0440..33307fc05c4d 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -68,7 +68,8 @@ static noinline struct mem_section __ref *sparse_index_alloc(int nid)
68 if (slab_is_available()) 68 if (slab_is_available())
69 section = kzalloc_node(array_size, GFP_KERNEL, nid); 69 section = kzalloc_node(array_size, GFP_KERNEL, nid);
70 else 70 else
71 section = memblock_alloc_node(array_size, 0, nid); 71 section = memblock_alloc_node(array_size, SMP_CACHE_BYTES,
72 nid);
72 73
73 return section; 74 return section;
74} 75}