Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
pagewalk.c File Reference
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/sched.h>
#include <linux/hugetlb.h>

Go to the source code of this file.

Functions

int walk_page_range (unsigned long addr, unsigned long end, struct mm_walk *walk)
 

Function Documentation

int walk_page_range ( unsigned long  addr,
unsigned long  end,
struct mm_walk *  walk 
)

walk_page_range - walk a memory map's page tables with a callback : starting address : ending address : set of callbacks to invoke for each level of the tree

Recursively walk the page table for the memory area in a VMA, calling supplied callbacks. Callbacks are called in-order (first PGD, first PUD, first PMD, first PTE, second PTE... second PMD, etc.). If lower-level callbacks are omitted, walking depth is reduced.

Each callback receives an entry pointer and the start and end of the associated range, and a copy of the original mm_walk for access to the ->private or ->mm fields.

Usually no locks are taken, but splitting transparent huge page may take page table lock. And the bottom level iterator will map PTE directories from highmem if necessary.

If any callback returns a non-zero value, the walk is aborted and the return value is propagated back to the caller. Otherwise 0 is returned.

walk->mm->mmap_sem must be held for at least read if walk->hugetlb_entry is !NULL.

Definition at line 188 of file pagewalk.c.