Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
numa_32.c File Reference
#include <linux/bootmem.h>
#include <linux/memblock.h>
#include <linux/module.h>
#include "numa_internal.h"

Go to the source code of this file.

Macros

#define LARGE_PAGE_BYTES   (PTRS_PER_PTE * PAGE_SIZE)
 

Functions

void set_pmd_pfn (unsigned long vaddr, unsigned long pfn, pgprot_t flags)
 
voidalloc_remap (int nid, unsigned long size)
 
void __init init_alloc_remap (int nid, u64 start, u64 end)
 
void __init initmem_init (void)
 

Variables

unsigned long highend_pfn
 
unsigned long highstart_pfn
 

Macro Definition Documentation

#define LARGE_PAGE_BYTES   (PTRS_PER_PTE * PAGE_SIZE)

Definition at line 76 of file numa_32.c.

Function Documentation

void* alloc_remap ( int  nid,
unsigned long  size 
)

alloc_remap - Allocate remapped memory : NUMA node to allocate memory from : The size of allocation

Allocate bytes from the remap area of NUMA node . The size of the remap area is predetermined by init_alloc_remap() and only the callers considered there should call this function. For more info, please read the comment on top of init_alloc_remap().

The caller must be ready to handle allocation failure from this function and fall back to regular memory allocator in such cases.

CONTEXT: Single CPU early boot context.

RETURNS: Pointer to the allocated memory on success, NULL on failure.

Definition at line 107 of file numa_32.c.

void __init init_alloc_remap ( int  nid,
u64  start,
u64  end 
)

init_alloc_remap - Initialize remap allocator for a NUMA node : NUMA node to initizlie remap allocator for

NUMA nodes may end up without any lowmem. As allocating pgdat and memmap on a different node with lowmem is inefficient, a special remap allocator is implemented which can be used by alloc_remap().

For each node, the amount of memory which will be necessary for pgdat and memmap is calculated and two memory areas of the size are allocated - one in the node and the other in lowmem; then, the area in the node is remapped to the lowmem area.

As pgdat and memmap must be allocated in lowmem anyway, this doesn't waste lowmem address space; however, the actual lowmem which gets remapped over is wasted. The amount shouldn't be problematic on machines this feature will be used.

Initialization failure isn't fatal. alloc_remap() is used opportunistically and the callers will fall back to other memory allocation mechanisms on failure.

Definition at line 180 of file numa_32.c.

void __init initmem_init ( void  )

Definition at line 237 of file numa_32.c.

void set_pmd_pfn ( unsigned long  vaddr,
unsigned long  pfn,
pgprot_t  flags 
)

Definition at line 35 of file pgtable.c.

Variable Documentation

unsigned long highend_pfn

Definition at line 45 of file init.c.

unsigned long highstart_pfn

Definition at line 45 of file init.c.