From: Thomas Tuttle Date: Fri, 6 Jun 2008 05:46:59 +0000 (-0700) Subject: pagemap: add documentation for pagemap X-Git-Tag: v2.6.26-rc6~38 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef421be741a3e56cb89088a7dd4f73cc38739d1b;p=linux-2.6 pagemap: add documentation for pagemap Just a quick explanation of the pagemap interface from a userspace point of view, and an example of how to use it (in English, not code). Signed-off-by: Thomas Tuttle Cc: Matt Mackall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/Documentation/vm/pagemap.txt b/Documentation/vm/pagemap.txt new file mode 100644 index 0000000000..ce72c0fe61 --- /dev/null +++ b/Documentation/vm/pagemap.txt @@ -0,0 +1,77 @@ +pagemap, from the userspace perspective +--------------------------------------- + +pagemap is a new (as of 2.6.25) set of interfaces in the kernel that allow +userspace programs to examine the page tables and related information by +reading files in /proc. + +There are three components to pagemap: + + * /proc/pid/pagemap. This file lets a userspace process find out which + physical frame each virtual page is mapped to. It contains one 64-bit + value for each virtual page, containing the following data (from + fs/proc/task_mmu.c, above pagemap_read): + + * Bits 0-55 page frame number (PFN) if present + * Bits 0-4 swap type if swapped + * Bits 5-55 swap offset if swapped + * Bits 55-60 page shift (page size = 1<