memory.c File Reference

Go to the source code of this file.

Defines

#define HAVE_PTE_SPECIAL   0
#define ZAP_BLOCK_SIZE   (1024 * PAGE_SIZE)
#define is_restart_addr(truncate_count)   (!((truncate_count) & ~PAGE_MASK))

Functions

 EXPORT_SYMBOL (max_mapnr)
 EXPORT_SYMBOL (mem_map)
 EXPORT_SYMBOL (num_physpages)
 EXPORT_SYMBOL (high_memory)
static int __init disable_randmaps (char *s)
 __setup ("norandmaps", disable_randmaps)
void pgd_clear_bad (pgd_t *pgd)
void pud_clear_bad (pud_t *pud)
void pmd_clear_bad (pmd_t *pmd)
static void free_pte_range (struct mmu_gather *tlb, pmd_t *pmd)
static void free_pmd_range (struct mmu_gather *tlb, pud_t *pud, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling)
static void free_pud_range (struct mmu_gather *tlb, pgd_t *pgd, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling)
void free_pgd_range (struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling)
void free_pgtables (struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long floor, unsigned long ceiling)
int __pte_alloc (struct mm_struct *mm, pmd_t *pmd, unsigned long address)
int __pte_alloc_kernel (pmd_t *pmd, unsigned long address)
static void add_mm_rss (struct mm_struct *mm, int file_rss, int anon_rss)
static void print_bad_pte (struct vm_area_struct *vma, unsigned long addr, pte_t pte, struct page *page)
static int is_cow_mapping (unsigned int flags)
struct page * vm_normal_page (struct vm_area_struct *vma, unsigned long addr, pte_t pte)
static void copy_one_pte (struct mm_struct *dst_mm, struct mm_struct *src_mm, pte_t *dst_pte, pte_t *src_pte, struct vm_area_struct *vma, unsigned long addr, int *rss)
static int copy_pte_range (struct mm_struct *dst_mm, struct mm_struct *src_mm, pmd_t *dst_pmd, pmd_t *src_pmd, struct vm_area_struct *vma, unsigned long addr, unsigned long end)
static int copy_pmd_range (struct mm_struct *dst_mm, struct mm_struct *src_mm, pud_t *dst_pud, pud_t *src_pud, struct vm_area_struct *vma, unsigned long addr, unsigned long end)
static int copy_pud_range (struct mm_struct *dst_mm, struct mm_struct *src_mm, pgd_t *dst_pgd, pgd_t *src_pgd, struct vm_area_struct *vma, unsigned long addr, unsigned long end)
int copy_page_range (struct mm_struct *dst_mm, struct mm_struct *src_mm, struct vm_area_struct *vma)
static unsigned long zap_pte_range (struct mmu_gather *tlb, struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long end, long *zap_work, struct zap_details *details)
static unsigned long zap_pmd_range (struct mmu_gather *tlb, struct vm_area_struct *vma, pud_t *pud, unsigned long addr, unsigned long end, long *zap_work, struct zap_details *details)
static unsigned long zap_pud_range (struct mmu_gather *tlb, struct vm_area_struct *vma, pgd_t *pgd, unsigned long addr, unsigned long end, long *zap_work, struct zap_details *details)
static unsigned long unmap_page_range (struct mmu_gather *tlb, struct vm_area_struct *vma, unsigned long addr, unsigned long end, long *zap_work, struct zap_details *details)
unsigned long unmap_vmas (struct mmu_gather **tlbp, struct vm_area_struct *vma, unsigned long start_addr, unsigned long end_addr, unsigned long *nr_accounted, struct zap_details *details)
 unmap_vmas - unmap a range of memory covered by a list of vma's : address of the caller's struct mmu_gather : the starting vma : virtual address at which to start unmapping : virtual address at which to end unmapping : Place number of unmapped pages in vm-accountable vma's here
unsigned long zap_page_range (struct vm_area_struct *vma, unsigned long address, unsigned long size, struct zap_details *details)
 zap_page_range - remove user pages in a given range : vm_area_struct holding the applicable pages : starting address of pages to zap : number of bytes to zap
int zap_vma_ptes (struct vm_area_struct *vma, unsigned long address, unsigned long size)
 zap_vma_ptes - remove ptes mapping the vma : vm_area_struct holding ptes to be zapped : starting address of pages to zap : number of bytes to zap
 EXPORT_SYMBOL_GPL (zap_vma_ptes)
struct page * follow_page (struct vm_area_struct *vma, unsigned long address, unsigned int flags)
static int use_zero_page (struct vm_area_struct *vma)
int __get_user_pages (struct task_struct *tsk, struct mm_struct *mm, unsigned long start, int len, int flags, struct page **pages, struct vm_area_struct **vmas)
int get_user_pages (struct task_struct *tsk, struct mm_struct *mm, unsigned long start, int len, int write, int force, struct page **pages, struct vm_area_struct **vmas)
 EXPORT_SYMBOL (get_user_pages)
pte_t * get_locked_pte (struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)
static int insert_page (struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot)
int vm_insert_page (struct vm_area_struct *vma, unsigned long addr, struct page *page)
 EXPORT_SYMBOL (vm_insert_page)
static int insert_pfn (struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, pgprot_t prot)
int vm_insert_pfn (struct vm_area_struct *vma, unsigned long addr, unsigned long pfn)
 vm_insert_pfn - insert single pfn into user vma : user vma to map to : target user address of this page : source kernel pfn
 EXPORT_SYMBOL (vm_insert_pfn)
int vm_insert_mixed (struct vm_area_struct *vma, unsigned long addr, unsigned long pfn)
 EXPORT_SYMBOL (vm_insert_mixed)
static int remap_pte_range (struct mm_struct *mm, pmd_t *pmd, unsigned long addr, unsigned long end, unsigned long pfn, pgprot_t prot)
static int remap_pmd_range (struct mm_struct *mm, pud_t *pud, unsigned long addr, unsigned long end, unsigned long pfn, pgprot_t prot)
static int remap_pud_range (struct mm_struct *mm, pgd_t *pgd, unsigned long addr, unsigned long end, unsigned long pfn, pgprot_t prot)
int remap_pfn_range (struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, unsigned long size, pgprot_t prot)
 remap_pfn_range - remap kernel memory to userspace : user vma to map to : target user address to start at : physical address of kernel memory : size of map area : page protection flags for this mapping
 EXPORT_SYMBOL (remap_pfn_range)
static int apply_to_pte_range (struct mm_struct *mm, pmd_t *pmd, unsigned long addr, unsigned long end, pte_fn_t fn, void *data)
static int apply_to_pmd_range (struct mm_struct *mm, pud_t *pud, unsigned long addr, unsigned long end, pte_fn_t fn, void *data)
static int apply_to_pud_range (struct mm_struct *mm, pgd_t *pgd, unsigned long addr, unsigned long end, pte_fn_t fn, void *data)
int apply_to_page_range (struct mm_struct *mm, unsigned long addr, unsigned long size, pte_fn_t fn, void *data)
 EXPORT_SYMBOL_GPL (apply_to_page_range)
static int pte_unmap_same (struct mm_struct *mm, pmd_t *pmd, pte_t *page_table, pte_t orig_pte)
static pte_t maybe_mkwrite (pte_t pte, struct vm_area_struct *vma)
static void cow_user_page (struct page *dst, struct page *src, unsigned long va, struct vm_area_struct *vma)
static int do_wp_page (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *page_table, pmd_t *pmd, spinlock_t *ptl, pte_t orig_pte)
static void reset_vma_truncate_counts (struct address_space *mapping)
static int unmap_mapping_range_vma (struct vm_area_struct *vma, unsigned long start_addr, unsigned long end_addr, struct zap_details *details)
static void unmap_mapping_range_tree (struct prio_tree_root *root, struct zap_details *details)
static void unmap_mapping_range_list (struct list_head *head, struct zap_details *details)
void unmap_mapping_range (struct address_space *mapping, loff_t const holebegin, loff_t const holelen, int even_cows)
 unmap_mapping_range - unmap the portion of all mmaps in the specified address_space corresponding to the specified page range in the underlying file.
 EXPORT_SYMBOL (unmap_mapping_range)
int vmtruncate (struct inode *inode, loff_t offset)
 vmtruncate - unmap mappings "freed" by truncate() syscall : inode of the file used : file offset to start truncating
 EXPORT_SYMBOL (vmtruncate)
int vmtruncate_range (struct inode *inode, loff_t offset, loff_t end)
static int do_swap_page (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *page_table, pmd_t *pmd, int write_access, pte_t orig_pte)
static int do_anonymous_page (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *page_table, pmd_t *pmd, int write_access)
static int __do_fault (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pmd_t *pmd, pgoff_t pgoff, unsigned int flags, pte_t orig_pte)
static int do_linear_fault (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *page_table, pmd_t *pmd, int write_access, pte_t orig_pte)
static int do_nonlinear_fault (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *page_table, pmd_t *pmd, int write_access, pte_t orig_pte)
static int handle_pte_fault (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *pte, pmd_t *pmd, int write_access)
int handle_mm_fault (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access)
int __pud_alloc (struct mm_struct *mm, pgd_t *pgd, unsigned long address)
int __pmd_alloc (struct mm_struct *mm, pud_t *pud, unsigned long address)
int make_pages_present (unsigned long addr, unsigned long end)
struct vm_area_struct * get_gate_vma (struct task_struct *tsk)
int in_gate_area_no_task (unsigned long addr)
int access_process_vm (struct task_struct *tsk, unsigned long addr, void *buf, int len, int write)
void print_vma_addr (char *prefix, unsigned long ip)

Variables

unsigned long max_mapnr
struct page * mem_map
unsigned long num_physpages
void * high_memory
: name of interface
dev_load - load a network module : the applicable net namespace

If a network interface is not present and the process has suitable privileges this function loads the module.

If module loading is not available in this kernel then it becomes a nop.

int randomize_va_space __read_mostly


Define Documentation

#define HAVE_PTE_SPECIAL   0

Definition at line 496 of file linux26/lib/src/mm/memory.c.

#define is_restart_addr ( truncate_count   )     (!((truncate_count) & ~PAGE_MASK))

Definition at line 2145 of file linux26/lib/src/mm/memory.c.

#define ZAP_BLOCK_SIZE   (1024 * PAGE_SIZE)

Definition at line 937 of file linux26/lib/src/mm/memory.c.


Function Documentation

static int __do_fault ( struct mm_struct *  mm,
struct vm_area_struct *  vma,
unsigned long  address,
pmd_t *  pmd,
pgoff_t  pgoff,
unsigned int  flags,
pte_t  orig_pte 
) [static]

Definition at line 2583 of file linux26/lib/src/mm/memory.c.

int __get_user_pages ( struct task_struct *  tsk,
struct mm_struct *  mm,
unsigned long  start,
int  len,
int  flags,
struct page **  pages,
struct vm_area_struct **  vmas 
)

Definition at line 1212 of file linux26/lib/src/mm/memory.c.

int __pmd_alloc ( struct mm_struct *  mm,
pud_t *  pud,
unsigned long  address 
)

Definition at line 2909 of file linux26/lib/src/mm/memory.c.

int __pte_alloc ( struct mm_struct *  mm,
pmd_t *  pmd,
unsigned long  address 
)

Definition at line 318 of file linux26/lib/src/mm/memory.c.

int __pte_alloc_kernel ( pmd_t *  pmd,
unsigned long  address 
)

Definition at line 351 of file linux26/lib/src/mm/memory.c.

int __pud_alloc ( struct mm_struct *  mm,
pgd_t *  pgd,
unsigned long  address 
)

Definition at line 2886 of file linux26/lib/src/mm/memory.c.

__setup ( "norandmaps"  ,
disable_randmaps   
)

int access_process_vm ( struct task_struct *  tsk,
unsigned long  addr,
void *  buf,
int  len,
int  write 
)

Definition at line 3079 of file linux26/lib/src/mm/memory.c.

static void add_mm_rss ( struct mm_struct *  mm,
int  file_rss,
int  anon_rss 
) [inline, static]

Definition at line 370 of file linux26/lib/src/mm/memory.c.

int apply_to_page_range ( struct mm_struct *  mm,
unsigned long  addr,
unsigned long  size,
pte_fn_t  fn,
void *  data 
)

Definition at line 1792 of file linux26/lib/src/mm/memory.c.

static int apply_to_pmd_range ( struct mm_struct *  mm,
pud_t *  pud,
unsigned long  addr,
unsigned long  end,
pte_fn_t  fn,
void *  data 
) [static]

Definition at line 1746 of file linux26/lib/src/mm/memory.c.

static int apply_to_pte_range ( struct mm_struct *  mm,
pmd_t *  pmd,
unsigned long  addr,
unsigned long  end,
pte_fn_t  fn,
void *  data 
) [static]

Definition at line 1712 of file linux26/lib/src/mm/memory.c.

static int apply_to_pud_range ( struct mm_struct *  mm,
pgd_t *  pgd,
unsigned long  addr,
unsigned long  end,
pte_fn_t  fn,
void *  data 
) [static]

Definition at line 1768 of file linux26/lib/src/mm/memory.c.

static void copy_one_pte ( struct mm_struct *  dst_mm,
struct mm_struct *  src_mm,
pte_t *  dst_pte,
pte_t *  src_pte,
struct vm_area_struct *  vma,
unsigned long  addr,
int *  rss 
) [inline, static]

Definition at line 550 of file linux26/lib/src/mm/memory.c.

int copy_page_range ( struct mm_struct *  dst_mm,
struct mm_struct *  src_mm,
struct vm_area_struct *  vma 
)

Definition at line 707 of file linux26/lib/src/mm/memory.c.

static int copy_pmd_range ( struct mm_struct *  dst_mm,
struct mm_struct *  src_mm,
pud_t *  dst_pud,
pud_t *  src_pud,
struct vm_area_struct *  vma,
unsigned long  addr,
unsigned long  end 
) [inline, static]

Definition at line 663 of file linux26/lib/src/mm/memory.c.

static int copy_pte_range ( struct mm_struct *  dst_mm,
struct mm_struct *  src_mm,
pmd_t *  dst_pmd,
pmd_t *  src_pmd,
struct vm_area_struct *  vma,
unsigned long  addr,
unsigned long  end 
) [static]

Definition at line 614 of file linux26/lib/src/mm/memory.c.

static int copy_pud_range ( struct mm_struct *  dst_mm,
struct mm_struct *  src_mm,
pgd_t *  dst_pgd,
pgd_t *  src_pgd,
struct vm_area_struct *  vma,
unsigned long  addr,
unsigned long  end 
) [inline, static]

Definition at line 685 of file linux26/lib/src/mm/memory.c.

static void cow_user_page ( struct page *  dst,
struct page *  src,
unsigned long  va,
struct vm_area_struct *  vma 
) [inline, static]

Definition at line 1852 of file linux26/lib/src/mm/memory.c.

static int __init disable_randmaps ( char *  s  )  [static]

Definition at line 109 of file linux26/lib/src/mm/memory.c.

static int do_anonymous_page ( struct mm_struct *  mm,
struct vm_area_struct *  vma,
unsigned long  address,
pte_t *  page_table,
pmd_t *  pmd,
int  write_access 
) [static]

Definition at line 2524 of file linux26/lib/src/mm/memory.c.

static int do_linear_fault ( struct mm_struct *  mm,
struct vm_area_struct *  vma,
unsigned long  address,
pte_t *  page_table,
pmd_t *  pmd,
int  write_access,
pte_t  orig_pte 
) [static]

Definition at line 2739 of file linux26/lib/src/mm/memory.c.

static int do_nonlinear_fault ( struct mm_struct *  mm,
struct vm_area_struct *  vma,
unsigned long  address,
pte_t *  page_table,
pmd_t *  pmd,
int  write_access,
pte_t  orig_pte 
) [static]

Definition at line 2760 of file linux26/lib/src/mm/memory.c.

static int do_swap_page ( struct mm_struct *  mm,
struct vm_area_struct *  vma,
unsigned long  address,
pte_t *  page_table,
pmd_t *  pmd,
int  write_access,
pte_t  orig_pte 
) [static]

Definition at line 2402 of file linux26/lib/src/mm/memory.c.

static int do_wp_page ( struct mm_struct *  mm,
struct vm_area_struct *  vma,
unsigned long  address,
pte_t *  page_table,
pmd_t *  pmd,
spinlock_t *  ptl,
pte_t  orig_pte 
) [static]

Definition at line 1896 of file linux26/lib/src/mm/memory.c.

EXPORT_SYMBOL ( vmtruncate   ) 

EXPORT_SYMBOL ( unmap_mapping_range   ) 

EXPORT_SYMBOL ( remap_pfn_range   ) 

EXPORT_SYMBOL ( vm_insert_mixed   ) 

EXPORT_SYMBOL ( vm_insert_pfn   ) 

EXPORT_SYMBOL ( vm_insert_page   ) 

EXPORT_SYMBOL ( get_user_pages   ) 

EXPORT_SYMBOL ( high_memory   ) 

EXPORT_SYMBOL ( num_physpages   ) 

EXPORT_SYMBOL ( mem_map   ) 

EXPORT_SYMBOL ( max_mapnr   ) 

EXPORT_SYMBOL_GPL ( apply_to_page_range   ) 

EXPORT_SYMBOL_GPL ( zap_vma_ptes   ) 

struct page* follow_page ( struct vm_area_struct *  vma,
unsigned long  address,
unsigned int  flags 
) [read]

Definition at line 1101 of file linux26/lib/src/mm/memory.c.

void free_pgd_range ( struct mmu_gather *  tlb,
unsigned long  addr,
unsigned long  end,
unsigned long  floor,
unsigned long  ceiling 
)

Definition at line 224 of file linux26/lib/src/mm/memory.c.

void free_pgtables ( struct mmu_gather *  tlb,
struct vm_area_struct *  vma,
unsigned long  floor,
unsigned long  ceiling 
)

Definition at line 284 of file linux26/lib/src/mm/memory.c.

static void free_pmd_range ( struct mmu_gather *  tlb,
pud_t *  pud,
unsigned long  addr,
unsigned long  end,
unsigned long  floor,
unsigned long  ceiling 
) [inline, static]

Definition at line 153 of file linux26/lib/src/mm/memory.c.

static void free_pte_range ( struct mmu_gather *  tlb,
pmd_t *  pmd 
) [static]

Definition at line 145 of file linux26/lib/src/mm/memory.c.

static void free_pud_range ( struct mmu_gather *  tlb,
pgd_t *  pgd,
unsigned long  addr,
unsigned long  end,
unsigned long  floor,
unsigned long  ceiling 
) [inline, static]

Definition at line 186 of file linux26/lib/src/mm/memory.c.

struct vm_area_struct* get_gate_vma ( struct task_struct *  tsk  )  [read]

Definition at line 2977 of file linux26/lib/src/mm/memory.c.

pte_t* get_locked_pte ( struct mm_struct *  mm,
unsigned long  addr,
spinlock_t **  ptl 
)

Definition at line 1384 of file linux26/lib/src/mm/memory.c.

int get_user_pages ( struct task_struct *  tsk,
struct mm_struct *  mm,
unsigned long  start,
int  len,
int  write,
int  force,
struct page **  pages,
struct vm_area_struct **  vmas 
)

Definition at line 1366 of file linux26/lib/src/mm/memory.c.

int handle_mm_fault ( struct mm_struct *  mm,
struct vm_area_struct *  vma,
unsigned long  address,
int  write_access 
)

Definition at line 2852 of file linux26/lib/src/mm/memory.c.

static int handle_pte_fault ( struct mm_struct *  mm,
struct vm_area_struct *  vma,
unsigned long  address,
pte_t *  pte,
pmd_t *  pmd,
int  write_access 
) [inline, static]

Definition at line 2796 of file linux26/lib/src/mm/memory.c.

int in_gate_area_no_task ( unsigned long  addr  ) 

Definition at line 2986 of file linux26/lib/src/mm/memory.c.

static int insert_page ( struct vm_area_struct *  vma,
unsigned long  addr,
struct page *  page,
pgprot_t  prot 
) [static]

Definition at line 1404 of file linux26/lib/src/mm/memory.c.

static int insert_pfn ( struct vm_area_struct *  vma,
unsigned long  addr,
unsigned long  pfn,
pgprot_t  prot 
) [static]

Definition at line 1473 of file linux26/lib/src/mm/memory.c.

static int is_cow_mapping ( unsigned int  flags  )  [inline, static]

Definition at line 446 of file linux26/lib/src/mm/memory.c.

int make_pages_present ( unsigned long  addr,
unsigned long  end 
)

Definition at line 2934 of file linux26/lib/src/mm/memory.c.

static pte_t maybe_mkwrite ( pte_t  pte,
struct vm_area_struct *  vma 
) [inline, static]

Definition at line 1845 of file linux26/lib/src/mm/memory.c.

void pgd_clear_bad ( pgd_t *  pgd  ) 

Definition at line 123 of file linux26/lib/src/mm/memory.c.

void pmd_clear_bad ( pmd_t *  pmd  ) 

Definition at line 135 of file linux26/lib/src/mm/memory.c.

static void print_bad_pte ( struct vm_area_struct *  vma,
unsigned long  addr,
pte_t  pte,
struct page *  page 
) [static]

Definition at line 385 of file linux26/lib/src/mm/memory.c.

void print_vma_addr ( char *  prefix,
unsigned long  ip 
)

Definition at line 3145 of file linux26/lib/src/mm/memory.c.

static int pte_unmap_same ( struct mm_struct *  mm,
pmd_t *  pmd,
pte_t *  page_table,
pte_t  orig_pte 
) [inline, static]

Definition at line 1823 of file linux26/lib/src/mm/memory.c.

void pud_clear_bad ( pud_t *  pud  ) 

Definition at line 129 of file linux26/lib/src/mm/memory.c.

int remap_pfn_range ( struct vm_area_struct *  vma,
unsigned long  addr,
unsigned long  pfn,
unsigned long  size,
pgprot_t  prot 
)

remap_pfn_range - remap kernel memory to userspace : user vma to map to : target user address to start at : physical address of kernel memory : size of map area : page protection flags for this mapping

Note: this is only safe if the mm semaphore is held when called.

Definition at line 1649 of file linux26/lib/src/mm/memory.c.

static int remap_pmd_range ( struct mm_struct *  mm,
pud_t *  pud,
unsigned long  addr,
unsigned long  end,
unsigned long  pfn,
pgprot_t  prot 
) [inline, static]

Definition at line 1599 of file linux26/lib/src/mm/memory.c.

static int remap_pte_range ( struct mm_struct *  mm,
pmd_t *  pmd,
unsigned long  addr,
unsigned long  end,
unsigned long  pfn,
pgprot_t  prot 
) [static]

Definition at line 1578 of file linux26/lib/src/mm/memory.c.

static int remap_pud_range ( struct mm_struct *  mm,
pgd_t *  pgd,
unsigned long  addr,
unsigned long  end,
unsigned long  pfn,
pgprot_t  prot 
) [inline, static]

Definition at line 1619 of file linux26/lib/src/mm/memory.c.

static void reset_vma_truncate_counts ( struct address_space *  mapping  )  [static]

Definition at line 2147 of file linux26/lib/src/mm/memory.c.

void unmap_mapping_range ( struct address_space *  mapping,
loff_t const   holebegin,
loff_t const   holelen,
int  even_cows 
)

unmap_mapping_range - unmap the portion of all mmaps in the specified address_space corresponding to the specified page range in the underlying file.

: the address space containing mmaps to be unmapped. : byte in first page to unmap, relative to the start of the underlying file. This will be rounded down to a PAGE_SIZE boundary. Note that this is different from vmtruncate(), which must keep the partial page. In contrast, we must get rid of partial pages. : size of prospective hole in bytes. This will be rounded up to a PAGE_SIZE boundary. A holelen of zero truncates to the end of the file. : 1 when truncating a file, unmap even private COWed pages; but 0 when invalidating pagecache, don't throw away private data.

Definition at line 2274 of file linux26/lib/src/mm/memory.c.

static void unmap_mapping_range_list ( struct list_head *  head,
struct zap_details *  details 
) [inline, static]

Definition at line 2237 of file linux26/lib/src/mm/memory.c.

static void unmap_mapping_range_tree ( struct prio_tree_root *  root,
struct zap_details *  details 
) [inline, static]

Definition at line 2205 of file linux26/lib/src/mm/memory.c.

static int unmap_mapping_range_vma ( struct vm_area_struct *  vma,
unsigned long  start_addr,
unsigned long  end_addr,
struct zap_details *  details 
) [static]

Definition at line 2158 of file linux26/lib/src/mm/memory.c.

static unsigned long unmap_page_range ( struct mmu_gather *  tlb,
struct vm_area_struct *  vma,
unsigned long  addr,
unsigned long  end,
long *  zap_work,
struct zap_details *  details 
) [static]

Definition at line 905 of file linux26/lib/src/mm/memory.c.

unsigned long unmap_vmas ( struct mmu_gather **  tlbp,
struct vm_area_struct *  vma,
unsigned long  start_addr,
unsigned long  end_addr,
unsigned long *  nr_accounted,
struct zap_details *  details 
)

unmap_vmas - unmap a range of memory covered by a list of vma's : address of the caller's struct mmu_gather : the starting vma : virtual address at which to start unmapping : virtual address at which to end unmapping : Place number of unmapped pages in vm-accountable vma's here

: details of nonlinear truncation or shared cache invalidation

Returns the end address of the unmapping (restart addr if interrupted).

Unmap all pages in the vma list.

We aim to not hold locks for too long (for scheduling latency reasons). So zap pages in ZAP_BLOCK_SIZE bytecounts. This means we need to return the ending mmu_gather to the caller.

Only addresses between `start' and `end' will be unmapped.

The VMA list must be sorted in ascending virtual address order.

unmap_vmas() assumes that the caller will flush the whole unmapped address range after unmap_vmas() returns. So the only responsibility here is to ensure that any thus-far unmapped pages are flushed before unmap_vmas() drops the lock and schedules.

Definition at line 966 of file linux26/lib/src/mm/memory.c.

static int use_zero_page ( struct vm_area_struct *  vma  )  [inline, static]

Definition at line 1193 of file linux26/lib/src/mm/memory.c.

int vm_insert_mixed ( struct vm_area_struct *  vma,
unsigned long  addr,
unsigned long  pfn 
)

Definition at line 1549 of file linux26/lib/src/mm/memory.c.

int vm_insert_page ( struct vm_area_struct *  vma,
unsigned long  addr,
struct page *  page 
)

Definition at line 1461 of file linux26/lib/src/mm/memory.c.

int vm_insert_pfn ( struct vm_area_struct *  vma,
unsigned long  addr,
unsigned long  pfn 
)

vm_insert_pfn - insert single pfn into user vma : user vma to map to : target user address of this page : source kernel pfn

Similar to vm_inert_page, this allows drivers to insert individual pages they've allocated into a user vma. Same comments apply.

This function should only be called from a vm_ops->fault handler, and in that case the handler should return NULL.

vma cannot be a COW mapping.

As this is called only for pages that do not currently exist, we do not need to flush old virtual caches or the TLB.

Definition at line 1518 of file linux26/lib/src/mm/memory.c.

struct page* vm_normal_page ( struct vm_area_struct *  vma,
unsigned long  addr,
pte_t  pte 
) [read]

Definition at line 498 of file linux26/lib/src/mm/memory.c.

int vmtruncate ( struct inode *  inode,
loff_t  offset 
)

vmtruncate - unmap mappings "freed" by truncate() syscall : inode of the file used : file offset to start truncating

NOTE! We have to be ready to update the memory sharing between the file and the memory map for a potential last incomplete page. Ugly, but necessary.

Definition at line 2325 of file linux26/lib/src/mm/memory.c.

int vmtruncate_range ( struct inode *  inode,
loff_t  offset,
loff_t  end 
)

Definition at line 2373 of file linux26/lib/src/mm/memory.c.

unsigned long zap_page_range ( struct vm_area_struct *  vma,
unsigned long  address,
unsigned long  size,
struct zap_details *  details 
)

zap_page_range - remove user pages in a given range : vm_area_struct holding the applicable pages : starting address of pages to zap : number of bytes to zap

: details of nonlinear truncation or shared cache invalidation

Definition at line 1058 of file linux26/lib/src/mm/memory.c.

static unsigned long zap_pmd_range ( struct mmu_gather *  tlb,
struct vm_area_struct *  vma,
pud_t *  pud,
unsigned long  addr,
unsigned long  end,
long *  zap_work,
struct zap_details *  details 
) [inline, static]

Definition at line 861 of file linux26/lib/src/mm/memory.c.

static unsigned long zap_pte_range ( struct mmu_gather *  tlb,
struct vm_area_struct *  vma,
pmd_t *  pmd,
unsigned long  addr,
unsigned long  end,
long *  zap_work,
struct zap_details *  details 
) [static]

Definition at line 769 of file linux26/lib/src/mm/memory.c.

static unsigned long zap_pud_range ( struct mmu_gather *  tlb,
struct vm_area_struct *  vma,
pgd_t *  pgd,
unsigned long  addr,
unsigned long  end,
long *  zap_work,
struct zap_details *  details 
) [inline, static]

Definition at line 883 of file linux26/lib/src/mm/memory.c.

int zap_vma_ptes ( struct vm_area_struct *  vma,
unsigned long  address,
unsigned long  size 
)

zap_vma_ptes - remove ptes mapping the vma : vm_area_struct holding ptes to be zapped : starting address of pages to zap : number of bytes to zap

This function only unmaps ptes assigned to VM_PFNMAP vmas.

The entire address range must be fully contained within the vma.

Returns 0 if successful.

Definition at line 1087 of file linux26/lib/src/mm/memory.c.


Variable Documentation

static struct Qdisc_ops pfifo_fast_ops __read_mostly [read]

Initial value:




                                        2

Definition at line 101 of file linux26/lib/src/mm/memory.c.

void* high_memory

Definition at line 90 of file linux26/lib/src/mm/memory.c.

unsigned long max_mapnr

Definition at line 71 of file linux26/lib/src/mm/memory.c.

struct page* mem_map

Definition at line 73 of file linux26/lib/src/mm/memory.c.

unsigned long num_physpages

Definition at line 82 of file linux26/lib/src/mm/memory.c.


Generated on Wed Apr 11 06:39:15 2012 for DDE - The L4 Device Driver Environment by  doxygen 1.5.6