cregit-Linux how code gets into the kernel

Release 4.14 arch/ia64/mm/discontig.c

Directory: arch/ia64/mm
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2000, 2003 Silicon Graphics, Inc.  All rights reserved.
 * Copyright (c) 2001 Intel Corp.
 * Copyright (c) 2001 Tony Luck <tony.luck@intel.com>
 * Copyright (c) 2002 NEC Corp.
 * Copyright (c) 2002 Kimio Suganuma <k-suganuma@da.jp.nec.com>
 * Copyright (c) 2004 Silicon Graphics, Inc
 *      Russ Anderson <rja@sgi.com>
 *      Jesse Barnes <jbarnes@sgi.com>
 *      Jack Steiner <steiner@sgi.com>
 */

/*
 * Platform initialization for Discontig Memory
 */

#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/nmi.h>
#include <linux/swap.h>
#include <linux/bootmem.h>
#include <linux/acpi.h>
#include <linux/efi.h>
#include <linux/nodemask.h>
#include <linux/slab.h>
#include <asm/pgalloc.h>
#include <asm/tlb.h>
#include <asm/meminit.h>
#include <asm/numa.h>
#include <asm/sections.h>

/*
 * Track per-node information needed to setup the boot memory allocator, the
 * per-node areas, and the real VM.
 */

struct early_node_data {
	
struct ia64_node_data *node_data;
	
unsigned long pernode_addr;
	
unsigned long pernode_size;
#ifdef CONFIG_ZONE_DMA
	
unsigned long num_dma_physpages;
#endif
	
unsigned long min_pfn;
	
unsigned long max_pfn;
};


static struct early_node_data mem_data[MAX_NUMNODES] __initdata;

static nodemask_t memory_less_mask __initdata;


pg_data_t *pgdat_list[MAX_NUMNODES];

/*
 * To prevent cache aliasing effects, align per-node structures so that they
 * start at addresses that are strided by node number.
 */

#define MAX_NODE_ALIGN_OFFSET	(32 * 1024 * 1024)

#define NODEDATA_ALIGN(addr, node)						\
	((((addr) + 1024*1024-1) & ~(1024*1024-1)) +                            \
             (((node)*PERCPU_PAGE_SIZE) & (MAX_NODE_ALIGN_OFFSET - 1)))

/**
 * build_node_maps - callback to setup bootmem structs for each node
 * @start: physical start of range
 * @len: length of range
 * @node: node where this range resides
 *
 * We allocate a struct bootmem_data for each piece of memory that we wish to
 * treat as a virtually contiguous block (i.e. each node). Each such block
 * must start on an %IA64_GRANULE_SIZE boundary, so we round the address down
 * if necessary.  Any non-existent pages will simply be part of the virtual
 * memmap.  We also update min_low_pfn and max_low_pfn here as we receive
 * memory ranges from the caller.
 */

static int __init build_node_maps(unsigned long start, unsigned long len, int node) { unsigned long spfn, epfn, end = start + len; struct bootmem_data *bdp = &bootmem_node_data[node]; epfn = GRANULEROUNDUP(end) >> PAGE_SHIFT; spfn = GRANULEROUNDDOWN(start) >> PAGE_SHIFT; if (!bdp->node_low_pfn) { bdp->node_min_pfn = spfn; bdp->node_low_pfn = epfn; } else { bdp->node_min_pfn = min(spfn, bdp->node_min_pfn); bdp->node_low_pfn = max(epfn, bdp->node_low_pfn); } return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Kimio Suganuma8273.21%125.00%
David Mosberger-Tang2017.86%125.00%
Johannes Weiner108.93%250.00%
Total112100.00%4100.00%

/** * early_nr_cpus_node - return number of cpus on a given node * @node: node to check * * Count the number of cpus on @node. We can't use nr_cpus_node() yet because * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been * called yet. Note that node 0 will also count all non-existent cpus. */
static int __meminit early_nr_cpus_node(int node) { int cpu, n = 0; for_each_possible_early_cpu(cpu) if (node == node_cpuid[cpu].nid) n++; return n; }

Contributors

PersonTokensPropCommitsCommitProp
Russ Anderson2565.79%125.00%
Bob Picco821.05%125.00%
Robin Holt410.53%125.00%
Yasunori Goto12.63%125.00%
Total38100.00%4100.00%

/** * compute_pernodesize - compute size of pernode data * @node: the node id. */
static unsigned long __meminit compute_pernodesize(int node) { unsigned long pernodesize = 0, cpus; cpus = early_nr_cpus_node(node); pernodesize += PERCPU_PAGE_SIZE * cpus; pernodesize += node * L1_CACHE_BYTES; pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t)); pernodesize += L1_CACHE_ALIGN(sizeof(struct ia64_node_data)); pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t)); pernodesize = PAGE_ALIGN(pernodesize); return pernodesize; }

Contributors

PersonTokensPropCommitsCommitProp
Bob Picco6886.08%133.33%
Robin Holt1012.66%133.33%
Yasunori Goto11.27%133.33%
Total79100.00%3100.00%

/** * per_cpu_node_setup - setup per-cpu areas on each node * @cpu_data: per-cpu area on this node * @node: node to setup * * Copy the static per-cpu data into the region we just set aside and then * setup __per_cpu_offset for each CPU on this node. Return a pointer to * the end of the area. */
static void *per_cpu_node_setup(void *cpu_data, int node) { #ifdef CONFIG_SMP int cpu; for_each_possible_early_cpu(cpu) { void *src = cpu == 0 ? __cpu0_per_cpu : __phys_per_cpu_start; if (node != node_cpuid[cpu].nid) continue; memcpy(__va(cpu_data), src, __per_cpu_end - __per_cpu_start); __per_cpu_offset[cpu] = (char *)__va(cpu_data) - __per_cpu_start; /* * percpu area for cpu0 is moved from the __init area * which is setup by head.S and used till this point. * Update ar.k3. This move is ensures that percpu * area for cpu0 is on the correct node and its * virtual address isn't insanely far from other * percpu areas which is important for congruent * percpu allocator. */ if (cpu == 0) ia64_set_kr(IA64_KR_PER_CPU_DATA, (unsigned long)cpu_data - (unsigned long)__per_cpu_start); cpu_data += PERCPU_PAGE_SIZE; } #endif return cpu_data; }

Contributors

PersonTokensPropCommitsCommitProp
Tony Luck7566.37%360.00%
Tejun Heo3430.09%120.00%
Robin Holt43.54%120.00%
Total113100.00%5100.00%

#ifdef CONFIG_SMP /** * setup_per_cpu_areas - setup percpu areas * * Arch code has already allocated and initialized percpu areas. All * this function has to do is to teach the determined layout to the * dynamic percpu allocator, which happens to be more complex than * creating whole new ones using helpers. */
void __init setup_per_cpu_areas(void) { struct pcpu_alloc_info *ai; struct pcpu_group_info *uninitialized_var(gi); unsigned int *cpu_map; void *base; unsigned long base_offset; unsigned int cpu; ssize_t static_size, reserved_size, dyn_size; int node, prev_node, unit, nr_units, rc; ai = pcpu_alloc_alloc_info(MAX_NUMNODES, nr_cpu_ids); if (!ai) panic("failed to allocate pcpu_alloc_info"); cpu_map = ai->groups[0].cpu_map; /* determine base */ base = (void *)ULONG_MAX; for_each_possible_cpu(cpu) base = min(base, (void *)(__per_cpu_offset[cpu] + __per_cpu_start)); base_offset = (void *)__per_cpu_start - base; /* build cpu_map, units are grouped by node */ unit = 0; for_each_node(node) for_each_possible_cpu(cpu) if (node == node_cpuid[cpu].nid) cpu_map[unit++] = cpu; nr_units = unit; /* set basic parameters */ static_size = __per_cpu_end - __per_cpu_start; reserved_size = PERCPU_MODULE_RESERVE; dyn_size = PERCPU_PAGE_SIZE - static_size - reserved_size; if (dyn_size < 0) panic("percpu area overflow static=%zd reserved=%zd\n", static_size, reserved_size); ai->static_size = static_size; ai->reserved_size = reserved_size; ai->dyn_size = dyn_size; ai->unit_size = PERCPU_PAGE_SIZE; ai->atom_size = PAGE_SIZE; ai->alloc_size = PERCPU_PAGE_SIZE; /* * CPUs are put into groups according to node. Walk cpu_map * and create new groups at node boundaries. */ prev_node = -1; ai->nr_groups = 0; for (unit = 0; unit < nr_units; unit++) { cpu = cpu_map[unit]; node = node_cpuid[cpu].nid; if (node == prev_node) { gi->nr_units++; continue; } prev_node = node; gi = &ai->groups[ai->nr_groups++]; gi->nr_units = 1; gi->base_offset = __per_cpu_offset[cpu] + base_offset; gi->cpu_map = &cpu_map[unit]; } rc = pcpu_setup_first_chunk(ai, base); if (rc) panic("failed to setup percpu area (err=%d)", rc); pcpu_free_alloc_info(ai); }

Contributors

PersonTokensPropCommitsCommitProp
Tejun Heo361100.00%1100.00%
Total361100.00%1100.00%

#endif /** * fill_pernode - initialize pernode data. * @node: the node id. * @pernode: physical address of pernode data * @pernodesize: size of the pernode data */
static void __init fill_pernode(int node, unsigned long pernode, unsigned long pernodesize) { void *cpu_data; int cpus = early_nr_cpus_node(node); struct bootmem_data *bdp = &bootmem_node_data[node]; mem_data[node].pernode_addr = pernode; mem_data[node].pernode_size = pernodesize; memset(__va(pernode), 0, pernodesize); cpu_data = (void *)pernode; pernode += PERCPU_PAGE_SIZE * cpus; pernode += node * L1_CACHE_BYTES; pgdat_list[node] = __va(pernode); pernode += L1_CACHE_ALIGN(sizeof(pg_data_t)); mem_data[node].node_data = __va(pernode); pernode += L1_CACHE_ALIGN(sizeof(struct ia64_node_data)); pgdat_list[node]->bdata = bdp; pernode += L1_CACHE_ALIGN(sizeof(pg_data_t)); cpu_data = per_cpu_node_setup(cpu_data, node); return; }

Contributors

PersonTokensPropCommitsCommitProp
Bob Picco14991.41%116.67%
Russ Anderson63.68%116.67%
Tony Luck31.84%116.67%
Yasunori Goto21.23%116.67%
David Mosberger-Tang21.23%116.67%
Johannes Weiner10.61%116.67%
Total163100.00%6100.00%

/** * find_pernode_space - allocate memory for memory map and per-node structures * @start: physical start of range * @len: length of range * @node: node where this range resides * * This routine reserves space for the per-cpu data struct, the list of * pg_data_ts and the per-node data struct. Each node will have something like * the following in the first chunk of addr. space large enough to hold it. * * ________________________ * | | * |~~~~~~~~~~~~~~~~~~~~~~~~| <-- NODEDATA_ALIGN(start, node) for the first * | PERCPU_PAGE_SIZE * | start and length big enough * | cpus_on_this_node | Node 0 will also have entries for all non-existent cpus. * |------------------------| * | local pg_data_t * | * |------------------------| * | local ia64_node_data | * |------------------------| * | ??? | * |________________________| * * Once this space has been set aside, the bootmem maps are initialized. We * could probably move the allocation of the per-cpu and ia64_node_data space * outside of this function and use alloc_bootmem_node(), but doing it here * is straightforward and we get the alignments we want so... */
static int __init find_pernode_space(unsigned long start, unsigned long len, int node) { unsigned long spfn, epfn; unsigned long pernodesize = 0, pernode, pages, mapsize; struct bootmem_data *bdp = &bootmem_node_data[node]; spfn = start >> PAGE_SHIFT; epfn = (start + len) >> PAGE_SHIFT; pages = bdp->node_low_pfn - bdp->node_min_pfn; mapsize = bootmem_bootmap_pages(pages) << PAGE_SHIFT; /* * Make sure this memory falls within this node's usable memory * since we may have thrown some away in build_maps(). */ if (spfn < bdp->node_min_pfn || epfn > bdp->node_low_pfn) return 0; /* Don't setup this node's local space twice... */ if (mem_data[node].pernode_addr) return 0; /* * Calculate total size needed, incl. what's necessary * for good alignment and alias prevention. */ pernodesize = compute_pernodesize(node); pernode = NODEDATA_ALIGN(start, node); /* Is this range big enough for what we want to store here? */ if (start + len > (pernode + pernodesize + mapsize)) fill_pernode(node, pernode, pernodesize); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Kimio Suganuma4528.66%114.29%
David Mosberger-Tang3723.57%114.29%
Bob Picco3220.38%114.29%
Jesse Barnes2616.56%114.29%
Johannes Weiner127.64%228.57%
Russ Anderson53.18%114.29%
Total157100.00%7100.00%

/** * free_node_bootmem - free bootmem allocator memory for use * @start: physical start of range * @len: length of range * @node: node where this range resides * * Simply calls the bootmem allocator to free the specified ranged from * the given pg_data_t's bdata struct. After this function has been called * for all the entries in the EFI memory map, the bootmem allocator will * be ready to service allocation requests. */
static int __init free_node_bootmem(unsigned long start, unsigned long len, int node) { free_bootmem_node(pgdat_list[node], start, len); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Bob Picco3090.91%133.33%
Jack Steiner26.06%133.33%
Yasunori Goto13.03%133.33%
Total33100.00%3100.00%

/** * reserve_pernode_space - reserve memory for per-node space * * Reserve the space used by the bootmem maps & per-node space in the boot * allocator so that when we actually create the real mem maps we don't * use their memory. */
static void __init reserve_pernode_space(void) { unsigned long base, size, pages; struct bootmem_data *bdp; int node; for_each_online_node(node) { pg_data_t *pdp = pgdat_list[node]; if (node_isset(node, memory_less_mask)) continue; bdp = pdp->bdata; /* First the bootmem_map itself */ pages = bdp->node_low_pfn - bdp->node_min_pfn; size = bootmem_bootmap_pages(pages) << PAGE_SHIFT; base = __pa(bdp->node_bootmem_map); reserve_bootmem_node(pdp, base, size, BOOTMEM_DEFAULT); /* Now the per-node space */ size = mem_data[node].pernode_size; base = __pa(mem_data[node].pernode_addr); reserve_bootmem_node(pdp, base, size, BOOTMEM_DEFAULT); } }

Contributors

PersonTokensPropCommitsCommitProp
Bob Picco9170.54%116.67%
David Mosberger-Tang2015.50%116.67%
Kimio Suganuma129.30%116.67%
Bernhard Walle43.10%116.67%
Johannes Weiner10.78%116.67%
Yasunori Goto10.78%116.67%
Total129100.00%6100.00%


static void __meminit scatter_node_data(void) { pg_data_t **dst; int node; /* * for_each_online_node() can't be used at here. * node_online_map is not set for hot-added nodes at this time, * because we are halfway through initialization of the new node's * structures. If for_each_online_node() is used, a new node's * pg_data_ptrs will be not initialized. Instead of using it, * pgdat_list[] is checked. */ for_each_node(node) { if (pgdat_list[node]) { dst = LOCAL_DATA_ADDR(pgdat_list[node])->pg_data_ptrs; memcpy(dst, pgdat_list, sizeof(pgdat_list)); } } }

Contributors

PersonTokensPropCommitsCommitProp
Yasunori Goto2747.37%222.22%
Bob Picco1424.56%111.11%
Russ Anderson915.79%222.22%
Tony Luck35.26%111.11%
Kimio Suganuma23.51%111.11%
Simon Arlott11.75%111.11%
David Mosberger-Tang11.75%111.11%
Total57100.00%9100.00%

/** * initialize_pernode_data - fixup per-cpu & per-node pointers * * Each node's per-node area has a copy of the global pg_data_t list, so * we copy that to each node here, as well as setting the per-cpu pointer * to the local node data structure. The active_cpus field of the per-node * structure gets setup by the platform_cpu_init() function later. */
static void __init initialize_pernode_data(void) { int cpu, node; scatter_node_data(); #ifdef CONFIG_SMP /* Set the node_data pointer for each per-cpu struct */ for_each_possible_early_cpu(cpu) { node = node_cpuid[cpu].nid; per_cpu(ia64_cpu_info, cpu).node_data = mem_data[node].node_data; } #else { struct cpuinfo_ia64 *cpu0_cpu_info; cpu = 0; node = node_cpuid[cpu].nid; cpu0_cpu_info = (struct cpuinfo_ia64 *)(__phys_per_cpu_start + ((char *)&ia64_cpu_info - __per_cpu_start)); cpu0_cpu_info->node_data = mem_data[node].node_data; } #endif /* CONFIG_SMP */ }

Contributors

PersonTokensPropCommitsCommitProp
Tony Luck6054.55%111.11%
Yasunori Goto1614.55%111.11%
Bob Picco1311.82%111.11%
David Mosberger-Tang109.09%111.11%
Kimio Suganuma43.64%111.11%
Robin Holt43.64%111.11%
Tejun Heo10.91%111.11%
Alex Williamson10.91%111.11%
Rusty Russell10.91%111.11%
Total110100.00%9100.00%

/** * memory_less_node_alloc - * attempt to allocate memory on the best NUMA slit * node but fall back to any other node when __alloc_bootmem_node fails * for best. * @nid: node id * @pernodesize: size of this node's pernode data */
static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize) { void *ptr = NULL; u8 best = 0xff; int bestnode = -1, node, anynode = 0; for_each_online_node(node) { if (node_isset(node, memory_less_mask)) continue; else if (node_distance(nid, node) < best) { best = node_distance(nid, node); bestnode = node; } anynode = node; } if (bestnode == -1) bestnode = anynode; ptr = __alloc_bootmem_node(pgdat_list[bestnode], pernodesize, PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); return ptr; }

Contributors

PersonTokensPropCommitsCommitProp
Bob Picco10185.59%240.00%
David Mosberger-Tang108.47%120.00%
Kimio Suganuma65.08%120.00%
Yasunori Goto10.85%120.00%
Total118100.00%5100.00%

/** * memory_less_nodes - allocate and initialize CPU only nodes pernode * information. */
static void __init memory_less_nodes(void) { unsigned long pernodesize; void *pernode; int node; for_each_node_mask(node, memory_less_mask) { pernodesize = compute_pernodesize(node); pernode = memory_less_node_alloc(node, pernodesize); fill_pernode(node, __pa(pernode), pernodesize); } return; }

Contributors

PersonTokensPropCommitsCommitProp
Bob Picco2950.88%125.00%
Kimio Suganuma1526.32%125.00%
David Mosberger-Tang1017.54%125.00%
Matthew Dobson35.26%125.00%
Total57100.00%4100.00%

/** * find_memory - walk the EFI memory map and setup the bootmem allocator * * Called early in boot to setup the bootmem allocator, and to * allocate the per-cpu and per-node structures. */
void __init find_memory(void) { int node; reserve_memory(); if (num_online_nodes() == 0) { printk(KERN_ERR "node info missing!\n"); node_set_online(0); } nodes_or(memory_less_mask, memory_less_mask, node_online_map); min_low_pfn = -1; max_low_pfn = 0; /* These actually end up getting called by call_pernode_memory() */ efi_memmap_walk(filter_rsvd_memory, build_node_maps); efi_memmap_walk(filter_rsvd_memory, find_pernode_space); efi_memmap_walk(find_max_min_low_pfn, NULL); for_each_online_node(node) if (bootmem_node_data[node].node_low_pfn) { node_clear(node, memory_less_mask); mem_data[node].min_pfn = ~0UL; } efi_memmap_walk(filter_memory, register_active_ranges); /* * Initialize the boot memory maps in reverse order since that's * what the bootmem allocator expects */ for (node = MAX_NUMNODES - 1; node >= 0; node--) { unsigned long pernode, pernodesize, map; struct bootmem_data *bdp; if (!node_online(node)) continue; else if (node_isset(node, memory_less_mask)) continue; bdp = &bootmem_node_data[node]; pernode = mem_data[node].pernode_addr; pernodesize = mem_data[node].pernode_size; map = pernode + pernodesize; init_bootmem_node(pgdat_list[node], map>>PAGE_SHIFT, bdp->node_min_pfn, bdp->node_low_pfn); } efi_memmap_walk(filter_rsvd_memory, free_node_bootmem); reserve_pernode_space(); memory_less_nodes(); initialize_pernode_data(); max_pfn = max_low_pfn; find_initrd(); }

Contributors

PersonTokensPropCommitsCommitProp
Jesse Barnes8234.31%18.33%
Bob Picco5924.69%216.67%
David Mosberger-Tang4317.99%18.33%
Kimio Suganuma2410.04%18.33%
Matthew Dobson166.69%18.33%
Zou Nan hai72.93%18.33%
Johannes Weiner31.26%216.67%
Kochi Takayoshi20.84%18.33%
Menyhart Zoltan20.84%18.33%
Yasunori Goto10.42%18.33%
Total239100.00%12100.00%

#ifdef CONFIG_SMP /** * per_cpu_init - setup per-cpu variables * * find_pernode_space() does most of this already, we just need to set * local_per_cpu_offset */
void *per_cpu_init(void) { int cpu; static int first_time = 1; if (first_time) { first_time = 0; for_each_possible_early_cpu(cpu) per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu]; } return __per_cpu_start + __per_cpu_offset[smp_processor_id()]; }

Contributors

PersonTokensPropCommitsCommitProp
David Mosberger-Tang2853.85%125.00%
Ashok Raj1426.92%125.00%
Kimio Suganuma611.54%125.00%
Robin Holt47.69%125.00%
Total52100.00%4100.00%

#endif /* CONFIG_SMP */ /** * call_pernode_memory - use SRAT to call callback functions with node info * @start: physical start of range * @len: length of range * @arg: function to call for each range * * efi_memmap_walk() knows nothing about layout of memory across nodes. Find * out to which node a block of memory belongs. Ignore memory that we cannot * identify, and split blocks that run across multiple nodes. * * Take this opportunity to round the start address up and the end address * down to page boundaries. */
void call_pernode_memory(unsigned long start, unsigned long len, void *arg) { unsigned long rs, re, end = start + len; void (*func)(unsigned long, unsigned long, int); int i; start = PAGE_ALIGN(start); end &= PAGE_MASK; if (start >= end) return; func = arg; if (!num_node_memblks) { /* No SRAT table, so assume one node (node 0) */ if (start < end) (*func)(start, end - start, 0); return; } for (i = 0; i < num_node_memblks; i++) { rs = max(start, node_memblk[i].start_paddr); re = min(end, node_memblk[i].start_paddr + node_memblk[i].size); if (rs < re) (*func)(rs, re - rs, node_memblk[i].nid); if (re == end) break; } }

Contributors

PersonTokensPropCommitsCommitProp
David Mosberger-Tang17496.67%250.00%
Alex Williamson31.67%125.00%
Andrew Morton31.67%125.00%
Total180100.00%4100.00%

/** * count_node_pages - callback to build per-node memory info structures * @start: physical start of range * @len: length of range * @node: node where this range resides * * Each node has it's own number of physical pages, DMAable pages, start, and * end page frame number. This routine will be called by call_pernode_memory() * for each piece of usable memory and will setup these values for each node. * Very similar to build_maps(). */
static __init int count_node_pages(unsigned long start, unsigned long len, int node) { unsigned long end = start + len; #ifdef CONFIG_ZONE_DMA if (start <= __pa(MAX_DMA_ADDRESS)) mem_data[node].num_dma_physpages += (min(end, __pa(MAX_DMA_ADDRESS)) - start) >>PAGE_SHIFT; #endif start = GRANULEROUNDDOWN(start); end = GRANULEROUNDUP(end); mem_data[node].max_pfn = max(mem_data[node].max_pfn, end >> PAGE_SHIFT); mem_data[node].min_pfn = min(mem_data[node].min_pfn, start >> PAGE_SHIFT); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
David Mosberger-Tang11695.08%250.00%
Christoph Lameter54.10%125.00%
Keith Owens10.82%125.00%
Total122100.00%4100.00%

/** * paging_init - setup page tables * * paging_init() sets up the page tables for each node of the system and frees * the bootmem allocator memory for general use. */
void __init paging_init(void) { unsigned long max_dma; unsigned long pfn_offset = 0; unsigned long max_pfn = 0; int node; unsigned long max_zone_pfns[MAX_NR_ZONES]; max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; efi_memmap_walk(filter_rsvd_memory, count_node_pages); sparse_memory_present_with_active_regions(MAX_NUMNODES); sparse_init(); #ifdef CONFIG_VIRTUAL_MEM_MAP VMALLOC_END -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) * sizeof(struct page)); vmem_map = (struct page *) VMALLOC_END; efi_memmap_walk(create_mem_map_page_table, NULL); printk("Virtual mem_map starts at 0x%p\n", vmem_map); #endif for_each_online_node(node) { pfn_offset = mem_data[node].min_pfn; #ifdef CONFIG_VIRTUAL_MEM_MAP NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset; #endif if (mem_data[node].max_pfn > max_pfn) max_pfn = mem_data[node].max_pfn; } memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); #ifdef CONFIG_ZONE_DMA max_zone_pfns[ZONE_DMA] = max_dma; #endif max_zone_pfns[ZONE_NORMAL] = max_pfn; free_area_init_nodes(max_zone_pfns); zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); }

Contributors

PersonTokensPropCommitsCommitProp
David Mosberger-Tang9747.32%216.67%
Bob Picco5024.39%433.33%
Mel Gorman4421.46%216.67%
Matthew Dobson62.93%18.33%
Christoph Lameter52.44%18.33%
Tejun Heo20.98%18.33%
Keith Owens10.49%18.33%
Total205100.00%12100.00%

#ifdef CONFIG_MEMORY_HOTPLUG
pg_data_t *arch_alloc_nodedata(int nid) { unsigned long size = compute_pernodesize(nid); return kzalloc(size, GFP_KERNEL); }

Contributors

PersonTokensPropCommitsCommitProp
Yasunori Goto26100.00%1100.00%
Total26100.00%1100.00%


void arch_free_nodedata(pg_data_t *pgdat) { kfree(pgdat); }

Contributors

PersonTokensPropCommitsCommitProp
Yasunori Goto14100.00%1100.00%
Total14100.00%1100.00%


void arch_refresh_nodedata(int update_node, pg_data_t *update_pgdat) { pgdat_list[update_node] = update_pgdat; scatter_node_data(); }

Contributors

PersonTokensPropCommitsCommitProp
Yasunori Goto22100.00%1100.00%
Total22100.00%1100.00%

#endif #ifdef CONFIG_SPARSEMEM_VMEMMAP
int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node) { return vmemmap_populate_basepages(start, end, node); }

Contributors

PersonTokensPropCommitsCommitProp
Christoph Lameter2177.78%150.00%
Johannes Weiner622.22%150.00%
Total27100.00%2100.00%


void vmemmap_free(unsigned long start, unsigned long end) { }

Contributors

PersonTokensPropCommitsCommitProp
Tang Chen866.67%150.00%
Johannes Weiner433.33%150.00%
Total12100.00%2100.00%

#endif

Overall Contributors

PersonTokensPropCommitsCommitProp
Bob Picco65625.42%611.32%
David Mosberger-Tang62924.37%35.66%
Tejun Heo40715.77%59.43%
Kimio Suganuma2258.72%11.89%
Tony Luck1485.73%35.66%
Yasunori Goto1264.88%59.43%
Jesse Barnes1084.18%11.89%
Russ Anderson461.78%23.77%
Mel Gorman441.70%23.77%
Christoph Lameter411.59%23.77%
Johannes Weiner371.43%35.66%
Matthew Dobson291.12%23.77%
Robin Holt261.01%23.77%
Ashok Raj140.54%11.89%
Tang Chen80.31%11.89%
Zou Nan hai70.27%11.89%
Jack Steiner70.27%23.77%
Alex Williamson40.15%23.77%
Bernhard Walle40.15%11.89%
Andrew Morton30.12%11.89%
Prarit Bhargava30.12%11.89%
Kochi Takayoshi20.08%11.89%
Menyhart Zoltan20.08%11.89%
Keith Owens20.08%11.89%
Rusty Russell10.04%11.89%
Simon Arlott10.04%11.89%
Greg Kroah-Hartman10.04%11.89%
Total2581100.00%53100.00%
Directory: arch/ia64/mm
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.