From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762784AbYFESlT (ORCPT ); Thu, 5 Jun 2008 14:41:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754369AbYFESlK (ORCPT ); Thu, 5 Jun 2008 14:41:10 -0400 Received: from smtp-out.google.com ([216.239.33.17]:49082 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753684AbYFESlI (ORCPT ); Thu, 5 Jun 2008 14:41:08 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=received:message-id:date:from:to:subject:mime-version: content-type:content-transfer-encoding:content-disposition; b=N52DEtZZMKfTjr0C6fiZs0bApAFgjP75MmlKM5X4z49Iuoimv3VlNPx67Miqr2Z0r G89V21pdOcUL9LLMGXrww== Message-ID: <4ca0a85e0806051140m4709cddat793f72043cccc17@mail.gmail.com> Date: Thu, 5 Jun 2008 14:40:59 -0400 From: "Thomas Tuttle" To: mpm@selenic.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] pagemap: Add documentation for pagemap MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Documentation/vm/pagemap.txt | 77 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 77 insertions(+), 0 deletions(-) create mode 100644 Documentation/vm/pagemap.txt diff --git a/Documentation/vm/pagemap.txt b/Documentation/vm/pagemap.txt new file mode 100644 index 0000000..b33a5e4 --- /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<