imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,26 +1,26 @@
 void __init mmu_context_init(void) {
   /* Mark init_mm as being active on all possible CPUs since
    * we'll get called with prev == init_mm the first time
    * we schedule on a given CPU
    */
   init_mm.context.active = NR_CPUS;
   /*
    * Allocate the maps used by context management
    */
-  context_map = memblock_alloc(CTX_MAP_SIZE, 0);
-  context_mm = memblock_alloc(sizeof(void *) * (LAST_CONTEXT + 1), 0);
+  context_map = memblock_alloc(CTX_MAP_SIZE, SMP_CACHE_BYTES);
+  context_mm = memblock_alloc(sizeof(void *) * (LAST_CONTEXT + 1), SMP_CACHE_BYTES);
 #ifdef CONFIG_SMP
-  stale_map[boot_cpuid] = memblock_alloc(CTX_MAP_SIZE, 0);
+  stale_map[boot_cpuid] = memblock_alloc(CTX_MAP_SIZE, SMP_CACHE_BYTES);
   cpuhp_setup_state_nocalls(CPUHP_POWERPC_MMU_CTX_PREPARE, "powerpc/mmu/ctx:prepare", mmu_ctx_cpu_prepare, mmu_ctx_cpu_dead);
 #endif
   printk(KERN_INFO "MMU: Allocated %zu bytes of context maps for %d contexts\n", 2 * CTX_MAP_SIZE + (sizeof(void *) * (LAST_CONTEXT + 1)), LAST_CONTEXT - FIRST_CONTEXT + 1);
   /*
    * Some processors have too few contexts to reserve one for
    * init_mm, and require using context 0 for a normal task.
    * Other processors reserve the use of context zero for the kernel.
    * This code assumes FIRST_CONTEXT < 32.
    */
   context_map[0] = (1 << FIRST_CONTEXT) - 1;
   next_context = FIRST_CONTEXT;
   nr_free_contexts = LAST_CONTEXT - FIRST_CONTEXT + 1;
 }<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)
)
--- initial
+++ final
@@ -1,23 +1,23 @@
 int __ref msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count, struct device_node *of_node) {
   int size;
   if (!irq_count) return -EINVAL;
   size = BITS_TO_LONGS(irq_count) * sizeof(long);
   pr_debug("msi_bitmap: allocator bitmap size is 0x%x bytes\n", size);
   bmp->bitmap_from_slab = slab_is_available();
   if (bmp->bitmap_from_slab)
     bmp->bitmap = kzalloc(size, GFP_KERNEL);
   else {
-    bmp->bitmap = memblock_alloc(size, 0);
+    bmp->bitmap = memblock_alloc(size, SMP_CACHE_BYTES);
     /* the bitmap won't be freed from memblock allocator */
     kmemleak_not_leak(bmp->bitmap);
   }
   if (!bmp->bitmap) {
     pr_debug("msi_bitmap: ENOMEM allocating allocator bitmap!\n");
     return -ENOMEM;
   }
   /* We zalloc'ed the bitmap, so all irqs are free by default */
   spin_lock_init(&bmp->lock);
   bmp->of_node = of_node_get(of_node);
   bmp->irq_count = irq_count;
   return 0;
 }<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)
)
--- initial
+++ final
@@ -1,16 +1,16 @@
 static int __init eth_setup(char *str) {
   struct eth_init *new;
   char *error;
   int n, err;
   err = eth_parse(str, &n, &str, &error);
   if (err) {
     printk(KERN_ERR "eth_setup - Couldn't parse '%s' : %s\n", str, error);
     return 1;
   }
-  new = memblock_alloc(sizeof(*new), 0);
+  new = memblock_alloc(sizeof(*new), SMP_CACHE_BYTES);
   INIT_LIST_HEAD(&new->list);
   new->index = n;
   new->init = str;
   list_add_tail(&new->list, &eth_cmd_line);
   return 1;
 }<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)
)
--- initial
+++ final
@@ -1,41 +1,41 @@
 static int __init iss_net_setup(char *str) {
   struct iss_net_private *device = NULL;
   struct iss_net_init *new;
   struct list_head *ele;
   char *end;
   int rc;
   unsigned n;
   end = strchr(str, '=');
   if (!end) {
     pr_err("Expected '=' after device number\n");
     return 1;
   }
   *end = 0;
   rc = kstrtouint(str, 0, &n);
   *end = '=';
   if (rc < 0) {
     pr_err("Failed to parse '%s'\n", str);
     return 1;
   }
   str = end;
   spin_lock(&devices_lock);
   list_for_each(ele, &devices) {
     device = list_entry(ele, struct iss_net_private, device_list);
     if (device->index == n) break;
   }
   spin_unlock(&devices_lock);
   if (device && device->index == n) {
     pr_err("Device %u already configured\n", n);
     return 1;
   }
-  new = memblock_alloc(sizeof(*new), 0);
+  new = memblock_alloc(sizeof(*new), SMP_CACHE_BYTES);
   if (new == NULL) {
     pr_err("Alloc_bootmem failed\n");
     return 1;
   }
   INIT_LIST_HEAD(&new->list);
   new->index = n;
   new->init = str + 1;
   list_add_tail(&new->list, &eth_cmd_line);
   return 1;
 }<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)
)
--- initial
+++ final
@@ -1,41 +1,41 @@
 static int __init core99_nvram_setup(struct device_node *dp, unsigned long addr) {
   int i;
   u32 gen_bank0, gen_bank1;
   if (nvram_naddrs < 1) {
     printk(KERN_ERR "nvram: no address\n");
     return -EINVAL;
   }
-  nvram_image = memblock_alloc(NVRAM_SIZE, 0);
+  nvram_image = memblock_alloc(NVRAM_SIZE, SMP_CACHE_BYTES);
   nvram_data = ioremap(addr, NVRAM_SIZE * 2);
   nvram_naddrs = 1; /* Make sure we get the correct case */
   DBG("nvram: Checking bank 0...\n");
   gen_bank0 = core99_check((u8 *)nvram_data);
   gen_bank1 = core99_check((u8 *)nvram_data + NVRAM_SIZE);
   core99_bank = (gen_bank0 < gen_bank1) ? 1 : 0;
   DBG("nvram: gen0=%d, gen1=%d\n", gen_bank0, gen_bank1);
   DBG("nvram: Active bank is: %d\n", core99_bank);
   for (i = 0; i < NVRAM_SIZE; i++)
     nvram_image[i] = nvram_data[i + core99_bank * NVRAM_SIZE];
   ppc_md.nvram_read_val = core99_nvram_read_byte;
   ppc_md.nvram_write_val = core99_nvram_write_byte;
   ppc_md.nvram_read = core99_nvram_read;
   ppc_md.nvram_write = core99_nvram_write;
   ppc_md.nvram_size = core99_nvram_size;
   ppc_md.nvram_sync = core99_nvram_sync;
   ppc_md.machine_shutdown = core99_nvram_sync;
   /*
    * Maybe we could be smarter here though making an exclusive list
    * of known flash chips is a bit nasty as older OF didn't provide us
    * with a useful "compatible" entry. A solution would be to really
    * identify the chip using flash id commands and base ourselves on
    * a list of known chips IDs
    */
   if (of_device_is_compatible(dp, "amd-0137")) {
     core99_erase_bank = amd_erase_bank;
     core99_write_bank = amd_write_bank;
   } else {
     core99_erase_bank = sm_erase_bank;
     core99_write_bank = sm_write_bank;
   }
   return 0;
 }<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)
)
--- initial
+++ final
@@ -1,25 +1,25 @@
 void *__init prom_early_alloc(unsigned long size) {
   static u8 *mem;
   static size_t free_mem;
   void *res;
   if (free_mem < size) {
     const size_t chunk_size = max(PAGE_SIZE, size);
     /*
      * To mimimize the number of allocations, grab at least
      * PAGE_SIZE of memory (that's an arbitrary choice that's
      * fast enough on the platforms we care about while minimizing
      * wasted bootmem) and hand off chunks of it to callers.
      */
-    res = memblock_alloc(chunk_size, 0);
+    res = memblock_alloc(chunk_size, SMP_CACHE_BYTES);
     BUG_ON(!res);
     prom_early_allocated += chunk_size;
     memset(res, 0, chunk_size);
     free_mem = chunk_size;
     mem = res;
   }
   /* allocate from the local cache */
   free_mem -= size;
   res = mem;
   mem += size;
   return res;
 }<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)
)
--- initial
+++ final
@@ -1,22 +1,22 @@
 static int __init _setup_clkctrl_provider(struct device_node *np) {
   const __be32 *addrp;
   struct clkctrl_provider *provider;
   u64 size;
   int i;
-  provider = memblock_alloc(sizeof(*provider), 0);
+  provider = memblock_alloc(sizeof(*provider), SMP_CACHE_BYTES);
   if (!provider) return -ENOMEM;
   provider->node = np;
   provider->num_addrs = of_property_count_elems_of_size(np, "reg", sizeof(u32)) / 2;
-  provider->addr = memblock_alloc(sizeof(void *) * provider->num_addrs, 0);
+  provider->addr = memblock_alloc(sizeof(void *) * provider->num_addrs, SMP_CACHE_BYTES);
   if (!provider->addr) return -ENOMEM;
-  provider->size = memblock_alloc(sizeof(u32) * provider->num_addrs, 0);
+  provider->size = memblock_alloc(sizeof(u32) * provider->num_addrs, SMP_CACHE_BYTES);
   if (!provider->size) return -ENOMEM;
   for (i = 0; i < provider->num_addrs; i++) {
     addrp = of_get_address(np, i, &size, NULL);
     provider->addr[i] = (u32)of_translate_address(np, addrp);
     provider->size[i] = size;
     pr_debug("%s: %pOF: %x...%x\n", __func__, np, provider->addr[i], provider->addr[i] + provider->size[i]);
   }
   list_add(&provider->link, &clkctrl_providers);
   return 0;
 }<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)
)
--- initial
+++ final
@@ -1,7 +1,7 @@
 struct pci_controller *__init alloc_pci_controller(void) {
   struct pci_controller *hose;
-  hose = memblock_alloc(sizeof(*hose), 0);
+  hose = memblock_alloc(sizeof(*hose), SMP_CACHE_BYTES);
   *hose_tail = hose;
   hose_tail = &hose->next;
   return hose;
 }<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)
)
--- initial
+++ final
@@ -1,3 +1,3 @@
 struct resource *__init alloc_resource(void) {
-  return memblock_alloc(sizeof(struct resource), 0);
+  return memblock_alloc(sizeof(struct resource), SMP_CACHE_BYTES);
 }<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)
)
--- initial
+++ final
@@ -1,14 +1,14 @@
 void __init pci_create_OF_bus_map(void) {
   struct property *of_prop;
   struct device_node *dn;
-  of_prop = memblock_alloc(sizeof(struct property) + 256, 0);
+  of_prop = memblock_alloc(sizeof(struct property) + 256, SMP_CACHE_BYTES);
   dn = of_find_node_by_path("/");
   if (dn) {
     memset(of_prop, -1, sizeof(struct property) + 256);
     of_prop->name = "pci-OF-bus-map";
     of_prop->length = 256;
     of_prop->value = &of_prop[1];
     of_add_property(dn, of_prop);
     of_node_put(dn);
   }
 }<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)
)
--- initial
+++ final
@@ -1,38 +1,38 @@
 struct pci_iommu_arena *__init iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base, unsigned long window_size, unsigned long align) {
   unsigned long mem_size;
   struct pci_iommu_arena *arena;
   mem_size = window_size / (PAGE_SIZE / sizeof(unsigned long));
   /* Note that the TLB lookup logic uses bitwise concatenation,
      not addition, so the required arena alignment is based on
      the size of the window.  Retain the align parameter so that
      particular systems can over-align the arena.  */
   if (align < mem_size) align = mem_size;
 #ifdef CONFIG_DISCONTIGMEM
   arena = memblock_alloc_node(sizeof(*arena), align, nid);
   if (!NODE_DATA(nid) || !arena) {
     printk("%s: couldn't allocate arena from node %d\n"
            "    falling back to system-wide allocation\n",
            __func__, nid);
-    arena = memblock_alloc(sizeof(*arena), 0);
+    arena = memblock_alloc(sizeof(*arena), SMP_CACHE_BYTES);
   }
   arena->ptes = memblock_alloc_node(sizeof(*arena), align, nid);
   if (!NODE_DATA(nid) || !arena->ptes) {
     printk("%s: couldn't allocate arena ptes from node %d\n"
            "    falling back to system-wide allocation\n",
            __func__, nid);
     arena->ptes = memblock_alloc_from(mem_size, align, 0);
   }
 #else  /* CONFIG_DISCONTIGMEM */
-  arena = memblock_alloc(sizeof(*arena), 0);
+  arena = memblock_alloc(sizeof(*arena), SMP_CACHE_BYTES);
   arena->ptes = memblock_alloc_from(mem_size, align, 0);
 #endif /* CONFIG_DISCONTIGMEM */
   spin_lock_init(&arena->lock);
   arena->hose = hose;
   arena->dma_base = base;
   arena->size = window_size;
   arena->next_entry = 0;
   /* Align allocations to a multiple of a page size.  Not needed
      unless there are chip bugs.  */
   arena->align_entry = 1;
   return arena;
 }<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)
)