--- initial
+++ final
@@ -1,52 +1,52 @@
 static struct pcpu_chunk *__init pcpu_alloc_first_chunk(unsigned long tmp_addr, int map_size) {
   struct pcpu_chunk *chunk;
   unsigned long aligned_addr, lcm_align;
   int start_offset, offset_bits, region_size, region_bits;
   /* region calculations */
   aligned_addr = tmp_addr & PAGE_MASK;
   start_offset = tmp_addr - aligned_addr;
   /*
    * Align the end of the region with the LCM of PAGE_SIZE and
    * PCPU_BITMAP_BLOCK_SIZE.  One of these constants is a multiple of
    * the other.
    */
   lcm_align = lcm(PAGE_SIZE, PCPU_BITMAP_BLOCK_SIZE);
   region_size = ALIGN(start_offset + map_size, lcm_align);
   /* allocate chunk */
-  chunk = memblock_alloc(sizeof(struct pcpu_chunk) + BITS_TO_LONGS(region_size >> PAGE_SHIFT), 0);
+  chunk = memblock_alloc(sizeof(struct pcpu_chunk) + BITS_TO_LONGS(region_size >> PAGE_SHIFT), SMP_CACHE_BYTES);
   INIT_LIST_HEAD(&chunk->list);
   chunk->base_addr = (void *)aligned_addr;
   chunk->start_offset = start_offset;
   chunk->end_offset = region_size - chunk->start_offset - map_size;
   chunk->nr_pages = region_size >> PAGE_SHIFT;
   region_bits = pcpu_chunk_map_bits(chunk);
-  chunk->alloc_map = memblock_alloc(BITS_TO_LONGS(region_bits) * sizeof(chunk->alloc_map[0]), 0);
-  chunk->bound_map = memblock_alloc(BITS_TO_LONGS(region_bits + 1) * sizeof(chunk->bound_map[0]), 0);
-  chunk->md_blocks = memblock_alloc(pcpu_chunk_nr_blocks(chunk) * sizeof(chunk->md_blocks[0]), 0);
+  chunk->alloc_map = memblock_alloc(BITS_TO_LONGS(region_bits) * sizeof(chunk->alloc_map[0]), SMP_CACHE_BYTES);
+  chunk->bound_map = memblock_alloc(BITS_TO_LONGS(region_bits + 1) * sizeof(chunk->bound_map[0]), SMP_CACHE_BYTES);
+  chunk->md_blocks = memblock_alloc(pcpu_chunk_nr_blocks(chunk) * sizeof(chunk->md_blocks[0]), SMP_CACHE_BYTES);
   pcpu_init_md_blocks(chunk);
   /* manage populated page bitmap */
   chunk->immutable = true;
   bitmap_fill(chunk->populated, chunk->nr_pages);
   chunk->nr_populated = chunk->nr_pages;
   chunk->nr_empty_pop_pages = pcpu_cnt_pop_pages(chunk, start_offset / PCPU_MIN_ALLOC_SIZE, map_size / PCPU_MIN_ALLOC_SIZE);
   chunk->contig_bits = map_size / PCPU_MIN_ALLOC_SIZE;
   chunk->free_bytes = map_size;
   if (chunk->start_offset) {
     /* hide the beginning of the bitmap */
     offset_bits = chunk->start_offset / PCPU_MIN_ALLOC_SIZE;
     bitmap_set(chunk->alloc_map, 0, offset_bits);
     set_bit(0, chunk->bound_map);
     set_bit(offset_bits, chunk->bound_map);
     chunk->first_bit = offset_bits;
     pcpu_block_update_hint_alloc(chunk, 0, offset_bits);
   }
   if (chunk->end_offset) {
     /* hide the end of the bitmap */
     offset_bits = chunk->end_offset / PCPU_MIN_ALLOC_SIZE;
     bitmap_set(chunk->alloc_map, pcpu_chunk_map_bits(chunk) - offset_bits, offset_bits);
     set_bit((start_offset + map_size) / PCPU_MIN_ALLOC_SIZE, chunk->bound_map);
     set_bit(region_bits, chunk->bound_map);
     pcpu_block_update_hint_alloc(chunk, pcpu_chunk_map_bits(chunk) - offset_bits, offset_bits);
   }
   return chunk;
 }<sep>@@
expression size, min_addr, max_addr, nid;
@@
(
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)