Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
hugetlb.c File Reference
#include <linux/list.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/seq_file.h>
#include <linux/sysctl.h>
#include <linux/highmem.h>
#include <linux/mmu_notifier.h>
#include <linux/nodemask.h>
#include <linux/pagemap.h>
#include <linux/mempolicy.h>
#include <linux/cpuset.h>
#include <linux/mutex.h>
#include <linux/bootmem.h>
#include <linux/sysfs.h>
#include <linux/slab.h>
#include <linux/rmap.h>
#include <linux/swap.h>
#include <linux/swapops.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/tlb.h>
#include <linux/io.h>
#include <linux/hugetlb.h>
#include <linux/hugetlb_cgroup.h>
#include <linux/node.h>
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  file_region
 
struct  resv_map
 

Macros

#define HPAGE_RESV_OWNER   (1UL << 0)
 
#define HPAGE_RESV_UNMAPPED   (1UL << 1)
 
#define HPAGE_RESV_MASK   (HPAGE_RESV_OWNER | HPAGE_RESV_UNMAPPED)
 
#define persistent_huge_pages(h)   (h->nr_huge_pages - h->surplus_huge_pages)
 
#define HSTATE_ATTR_RO(_name)   static struct kobj_attribute _name##_attr = __ATTR_RO(_name)
 
#define HSTATE_ATTR(_name)
 

Functions

__initdata LIST_HEAD (huge_boot_pages)
 
 DEFINE_SPINLOCK (hugetlb_lock)
 
struct hugepage_subpool * hugepage_new_subpool (long nr_blocks)
 
void hugepage_put_subpool (struct hugepage_subpool *spool)
 
pgoff_t linear_hugepage_index (struct vm_area_struct *vma, unsigned long address)
 
unsigned long vma_kernel_pagesize (struct vm_area_struct *vma)
 
 EXPORT_SYMBOL_GPL (vma_kernel_pagesize)
 
unsigned long vma_mmu_pagesize (struct vm_area_struct *vma)
 
void reset_vma_resv_huge_pages (struct vm_area_struct *vma)
 
void copy_huge_page (struct page *dst, struct page *src)
 
struct hstatesize_to_hstate (unsigned long size)
 
int PageHuge (struct page *page)
 
 EXPORT_SYMBOL_GPL (PageHuge)
 
struct pagealloc_huge_page_node (struct hstate *h, int nid)
 
int __weak alloc_bootmem_huge_page (struct hstate *h)
 
 HSTATE_ATTR (nr_hugepages)
 
 HSTATE_ATTR (nr_overcommit_hugepages)
 
 HSTATE_ATTR_RO (free_hugepages)
 
 HSTATE_ATTR_RO (resv_hugepages)
 
 HSTATE_ATTR_RO (surplus_hugepages)
 
 module_exit (hugetlb_exit)
 
 module_init (hugetlb_init)
 
void __init hugetlb_add_hstate (unsigned order)
 
 __setup ("hugepages=", hugetlb_nrpages_setup)
 
void hugetlb_report_meminfo (struct seq_file *m)
 
int hugetlb_report_node_meminfo (int nid, char *buf)
 
unsigned long hugetlb_total_pages (void)
 
int copy_hugetlb_page_range (struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma)
 
void __unmap_hugepage_range (struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page)
 
void __unmap_hugepage_range_final (struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page)
 
void unmap_hugepage_range (struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page)
 
int hugetlb_fault (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, unsigned int flags)
 
 __attribute__ ((weak))
 
int follow_hugetlb_page (struct mm_struct *mm, struct vm_area_struct *vma, struct page **pages, struct vm_area_struct **vmas, unsigned long *position, int *length, int i, unsigned int flags)
 
void hugetlb_change_protection (struct vm_area_struct *vma, unsigned long address, unsigned long end, pgprot_t newprot)
 
int hugetlb_reserve_pages (struct inode *inode, long from, long to, struct vm_area_struct *vma, vm_flags_t vm_flags)
 
void hugetlb_unreserve_pages (struct inode *inode, long offset, long freed)
 

Variables

const unsigned long hugetlb_zero = 0
 
const unsigned long hugetlb_infinity = ~0UL
 
unsigned long hugepages_treat_as_movable
 
int hugetlb_max_hstate __read_mostly
 
unsigned int default_hstate_idx
 
struct hstate hstates [HUGE_MAX_HSTATE]
 
struct vm_operations_struct hugetlb_vm_ops
 

Macro Definition Documentation

#define HPAGE_RESV_MASK   (HPAGE_RESV_OWNER | HPAGE_RESV_UNMAPPED)

Definition at line 346 of file hugetlb.c.

#define HPAGE_RESV_OWNER   (1UL << 0)

Definition at line 344 of file hugetlb.c.

#define HPAGE_RESV_UNMAPPED   (1UL << 1)

Definition at line 345 of file hugetlb.c.

#define HSTATE_ATTR (   _name)
Value:
static struct kobj_attribute _name##_attr = \
__ATTR(_name, 0644, _name##_show, _name##_store)

Definition at line 1464 of file hugetlb.c.

#define HSTATE_ATTR_RO (   _name)    static struct kobj_attribute _name##_attr = __ATTR_RO(_name)

Definition at line 1461 of file hugetlb.c.

#define persistent_huge_pages (   h)    (h->nr_huge_pages - h->surplus_huge_pages)

Definition at line 1386 of file hugetlb.c.

Function Documentation

__attribute__ ( (weak)  )
read

read_persistent_clock - Return time from the persistent clock.

Weak dummy function for arches that do not yet support it. Reads the time from the battery backed persistent clock. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

read_boot_clock - Return time of the system start.

Weak dummy function for arches that do not yet support it. Function to read the exact time the system has been started. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

__iowrite32_copy - copy data to MMIO space, in 32-bit units : destination, in MMIO space (must be 32-bit aligned) : source (must be 32-bit aligned) : number of 32-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

__iowrite64_copy - copy data to MMIO space, in 64-bit or 32-bit units : destination, in MMIO space (must be 64-bit aligned) : source (must be 64-bit aligned) : number of 64-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 or 64 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

Definition at line 2926 of file hugetlb.c.

__setup ( )
void __unmap_hugepage_range ( struct mmu_gather tlb,
struct vm_area_struct vma,
unsigned long  start,
unsigned long  end,
struct page ref_page 
)

Definition at line 2351 of file hugetlb.c.

void __unmap_hugepage_range_final ( struct mmu_gather tlb,
struct vm_area_struct vma,
unsigned long  start,
unsigned long  end,
struct page ref_page 
)

Definition at line 2439 of file hugetlb.c.

int __weak alloc_bootmem_huge_page ( struct hstate h)

Definition at line 1180 of file hugetlb.c.

struct page* alloc_huge_page_node ( struct hstate h,
int  nid 
)
read

Definition at line 928 of file hugetlb.c.

void copy_huge_page ( struct page dst,
struct page src 
)

Definition at line 491 of file hugetlb.c.

int copy_hugetlb_page_range ( struct mm_struct dst,
struct mm_struct src,
struct vm_area_struct vma 
)

Definition at line 2281 of file hugetlb.c.

DEFINE_SPINLOCK ( hugetlb_lock  )
EXPORT_SYMBOL_GPL ( vma_kernel_pagesize  )
EXPORT_SYMBOL_GPL ( PageHuge  )
int follow_hugetlb_page ( struct mm_struct mm,
struct vm_area_struct vma,
struct page **  pages,
struct vm_area_struct **  vmas,
unsigned long position,
int length,
int  i,
unsigned int  flags 
)

Definition at line 2934 of file hugetlb.c.

HSTATE_ATTR ( nr_hugepages  )
HSTATE_ATTR ( nr_overcommit_hugepages  )
HSTATE_ATTR_RO ( free_hugepages  )
HSTATE_ATTR_RO ( resv_hugepages  )
HSTATE_ATTR_RO ( surplus_hugepages  )
struct hugepage_subpool* hugepage_new_subpool ( long  nr_blocks)
read

Definition at line 67 of file hugetlb.c.

void hugepage_put_subpool ( struct hugepage_subpool *  spool)

Definition at line 83 of file hugetlb.c.

void __init hugetlb_add_hstate ( unsigned  order)

Definition at line 1923 of file hugetlb.c.

void hugetlb_change_protection ( struct vm_area_struct vma,
unsigned long  address,
unsigned long  end,
pgprot_t  newprot 
)

Definition at line 3017 of file hugetlb.c.

int hugetlb_fault ( struct mm_struct mm,
struct vm_area_struct vma,
unsigned long  address,
unsigned int  flags 
)

Definition at line 2816 of file hugetlb.c.

void hugetlb_report_meminfo ( struct seq_file m)

Definition at line 2108 of file hugetlb.c.

int hugetlb_report_node_meminfo ( int  nid,
char buf 
)

Definition at line 2124 of file hugetlb.c.

int hugetlb_reserve_pages ( struct inode inode,
long  from,
long  to,
struct vm_area_struct vma,
vm_flags_t  vm_flags 
)

Definition at line 3054 of file hugetlb.c.

unsigned long hugetlb_total_pages ( void  )

Definition at line 2137 of file hugetlb.c.

void hugetlb_unreserve_pages ( struct inode inode,
long  offset,
long  freed 
)

Definition at line 3131 of file hugetlb.c.

pgoff_t linear_hugepage_index ( struct vm_area_struct vma,
unsigned long  address 
)

Definition at line 303 of file hugetlb.c.

__initdata LIST_HEAD ( huge_boot_pages  )
module_exit ( hugetlb_exit  )
module_init ( hugetlb_init  )
int PageHuge ( struct page page)

Definition at line 679 of file hugetlb.c.

void reset_vma_resv_huge_pages ( struct vm_area_struct vma)

Definition at line 457 of file hugetlb.c.

struct hstate* size_to_hstate ( unsigned long  size)
read

Definition at line 602 of file hugetlb.c.

void unmap_hugepage_range ( struct vm_area_struct vma,
unsigned long  start,
unsigned long  end,
struct page ref_page 
)

Definition at line 2458 of file hugetlb.c.

unsigned long vma_kernel_pagesize ( struct vm_area_struct vma)

Definition at line 313 of file hugetlb.c.

unsigned long vma_mmu_pagesize ( struct vm_area_struct vma)

Definition at line 333 of file hugetlb.c.

Variable Documentation

int hugetlb_max_hstate __read_mostly

Definition at line 39 of file hugetlb.c.

unsigned int default_hstate_idx

Definition at line 40 of file hugetlb.c.

Definition at line 41 of file hugetlb.c.

unsigned long hugepages_treat_as_movable

Definition at line 37 of file hugetlb.c.

const unsigned long hugetlb_infinity = ~0UL

Definition at line 35 of file hugetlb.c.

struct vm_operations_struct hugetlb_vm_ops
Initial value:
= {
.fault = hugetlb_vm_op_fault,
.open = hugetlb_vm_op_open,
.close = hugetlb_vm_op_close,
}

Definition at line 2246 of file hugetlb.c.

const unsigned long hugetlb_zero = 0

Definition at line 35 of file hugetlb.c.