sparse-vmemmap.c (0aea30a07ec6b50de0fc5f5b2ec34a68ead86b61) sparse-vmemmap.c (47010c040dec8af6347ec6259104fc13f7e7e30a)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Virtual Memory Map support
4 *
5 * (C) 2007 sgi. Christoph Lameter.
6 *
7 * Virtual memory maps allow VM primitives pfn_to_page, page_to_pfn,
8 * virt_to_page, page_address() to be implemented as a base offset

--- 20 unchanged lines hidden (view full) ---

29#include <linux/sched.h>
30#include <linux/pgtable.h>
31#include <linux/bootmem_info.h>
32
33#include <asm/dma.h>
34#include <asm/pgalloc.h>
35#include <asm/tlbflush.h>
36
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Virtual Memory Map support
4 *
5 * (C) 2007 sgi. Christoph Lameter.
6 *
7 * Virtual memory maps allow VM primitives pfn_to_page, page_to_pfn,
8 * virt_to_page, page_address() to be implemented as a base offset

--- 20 unchanged lines hidden (view full) ---

29#include <linux/sched.h>
30#include <linux/pgtable.h>
31#include <linux/bootmem_info.h>
32
33#include <asm/dma.h>
34#include <asm/pgalloc.h>
35#include <asm/tlbflush.h>
36
37#ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
37#ifdef CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
38/**
39 * struct vmemmap_remap_walk - walk vmemmap page table
40 *
41 * @remap_pte: called for each lowest-level entry (PTE).
42 * @nr_walked: the number of walked pte.
43 * @reuse_page: the page which is reused for the tail vmemmap pages.
44 * @reuse_addr: the virtual address of the @reuse_page page.
45 * @vmemmap_pages: the list head of the vmemmap pages that can be freed

--- 369 unchanged lines hidden (view full) ---

415 return -ENOMEM;
416
417 mmap_read_lock(&init_mm);
418 vmemmap_remap_range(reuse, end, &walk);
419 mmap_read_unlock(&init_mm);
420
421 return 0;
422}
38/**
39 * struct vmemmap_remap_walk - walk vmemmap page table
40 *
41 * @remap_pte: called for each lowest-level entry (PTE).
42 * @nr_walked: the number of walked pte.
43 * @reuse_page: the page which is reused for the tail vmemmap pages.
44 * @reuse_addr: the virtual address of the @reuse_page page.
45 * @vmemmap_pages: the list head of the vmemmap pages that can be freed

--- 369 unchanged lines hidden (view full) ---

415 return -ENOMEM;
416
417 mmap_read_lock(&init_mm);
418 vmemmap_remap_range(reuse, end, &walk);
419 mmap_read_unlock(&init_mm);
420
421 return 0;
422}
423#endif /* CONFIG_HUGETLB_PAGE_FREE_VMEMMAP */
423#endif /* CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP */
424
425/*
426 * Allocate a block of memory to be used to back the virtual memory map
427 * or to back the page tables that are used to create the mapping.
428 * Uses the main allocators if they are available, else bootmem.
429 */
430
431static void * __ref __earlyonly_bootmem_alloc(int node,

--- 226 unchanged lines hidden ---
424
425/*
426 * Allocate a block of memory to be used to back the virtual memory map
427 * or to back the page tables that are used to create the mapping.
428 * Uses the main allocators if they are available, else bootmem.
429 */
430
431static void * __ref __earlyonly_bootmem_alloc(int node,

--- 226 unchanged lines hidden ---