]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - arch/ia64/mm/init.c
[PATCH] slab: remove SLAB_KERNEL
[mirror_ubuntu-jammy-kernel.git] / arch / ia64 / mm / init.c
index 38306e98f04b2877a076ae7ac4912dee3cebfbab..56dc2024220e424d2dd6e1d5de57c4c65e17a0e0 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) 1998-2003 Hewlett-Packard Co
  *     David Mosberger-Tang <davidm@hpl.hp.com>
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 
@@ -157,7 +156,7 @@ ia64_init_addr_space (void)
         * the problem.  When the process attempts to write to the register backing store
         * for the first time, it will get a SEGFAULT in this case.
         */
-       vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
+       vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
        if (vma) {
                memset(vma, 0, sizeof(*vma));
                vma->vm_mm = current->mm;
@@ -176,7 +175,7 @@ ia64_init_addr_space (void)
 
        /* map NaT-page at address zero to speed up speculative dereferencing of NULL: */
        if (!(current->personality & MMAP_PAGE_ZERO)) {
-               vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
+               vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
                if (vma) {
                        memset(vma, 0, sizeof(*vma));
                        vma->vm_mm = current->mm;
@@ -416,6 +415,61 @@ ia64_mmu_init (void *my_cpu_data)
 }
 
 #ifdef CONFIG_VIRTUAL_MEM_MAP
+int vmemmap_find_next_valid_pfn(int node, int i)
+{
+       unsigned long end_address, hole_next_pfn;
+       unsigned long stop_address;
+       pg_data_t *pgdat = NODE_DATA(node);
+
+       end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];
+       end_address = PAGE_ALIGN(end_address);
+
+       stop_address = (unsigned long) &vmem_map[
+               pgdat->node_start_pfn + pgdat->node_spanned_pages];
+
+       do {
+               pgd_t *pgd;
+               pud_t *pud;
+               pmd_t *pmd;
+               pte_t *pte;
+
+               pgd = pgd_offset_k(end_address);
+               if (pgd_none(*pgd)) {
+                       end_address += PGDIR_SIZE;
+                       continue;
+               }
+
+               pud = pud_offset(pgd, end_address);
+               if (pud_none(*pud)) {
+                       end_address += PUD_SIZE;
+                       continue;
+               }
+
+               pmd = pmd_offset(pud, end_address);
+               if (pmd_none(*pmd)) {
+                       end_address += PMD_SIZE;
+                       continue;
+               }
+
+               pte = pte_offset_kernel(pmd, end_address);
+retry_pte:
+               if (pte_none(*pte)) {
+                       end_address += PAGE_SIZE;
+                       pte++;
+                       if ((end_address < stop_address) &&
+                           (end_address != ALIGN(end_address, 1UL << PMD_SHIFT)))
+                               goto retry_pte;
+                       continue;
+               }
+               /* Found next valid vmem_map page */
+               break;
+       } while (end_address < stop_address);
+
+       end_address = min(end_address, stop_address);
+       end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1;
+       hole_next_pfn = end_address / sizeof(struct page);
+       return hole_next_pfn - pgdat->node_start_pfn;
+}
 
 int __init
 create_mem_map_page_table (u64 start, u64 end, void *arg)
@@ -539,6 +593,18 @@ find_largest_hole (u64 start, u64 end, void *arg)
        last_end = end;
        return 0;
 }
+
+int __init
+register_active_ranges(u64 start, u64 end, void *nid)
+{
+       BUG_ON(nid == NULL);
+       BUG_ON(*(unsigned long *)nid >= MAX_NUMNODES);
+
+       add_active_range(*(unsigned long *)nid,
+                               __pa(start) >> PAGE_SHIFT,
+                               __pa(end) >> PAGE_SHIFT);
+       return 0;
+}
 #endif /* CONFIG_VIRTUAL_MEM_MAP */
 
 static int __init