From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 22 00:41:05 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 495A9F51 for ; Sun, 22 Mar 2015 00:41:05 +0000 (UTC) Received: from mail-pd0-x233.google.com (mail-pd0-x233.google.com [IPv6:2607:f8b0:400e:c02::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1869112D for ; Sun, 22 Mar 2015 00:41:05 +0000 (UTC) Received: by pdbop1 with SMTP id op1so146893358pdb.2 for ; Sat, 21 Mar 2015 17:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=fZ+Hn326gOXaqv0b+XjKNtClvSe3RJ1w9Ur9UCKnEvY=; b=JUOLfmuIaVxQZT5WCAfrqm3dfmAGQhjt4ewT+cXmbttylmn+qUeMMYzFbBREr3Vn0Q Ui79ZWCTZjAeV58zMx3ncozPDrX53yfAc/ukXJY5Ep1evp2KT419qgKuNlBy2icw9Iaq ccS8MUqQeT8HwB97FzUo0fmXvF90Wf07MQprjOR2wAUDlaZnsGG5lUx0ygG38DF+S193 6CI60X3/tzJRbbfYE5l9PBWR/VuQPKYacFp1O5gG8r73l5JPeemRC6iSZfCs6dtxJQ/x p6prVwYM4RXaqAehn31SoC5Y91uhbxO6ODcfw83zpBs2kU62eUjE47b1T5LlPLQuIAJs ejBg== X-Received: by 10.70.125.129 with SMTP id mq1mr199617674pdb.70.1426984864569; Sat, 21 Mar 2015 17:41:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.179.203 with HTTP; Sat, 21 Mar 2015 17:40:34 -0700 (PDT) From: Yue Chen Date: Sat, 21 Mar 2015 20:40:34 -0400 Message-ID: Subject: How to traverse all resident pages in kernel? To: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2015 00:41:05 -0000 Hi all, For research purposes, I am trying to get all the virtual memory starting address of every page in kernel. First I tried to traverse vm_map_entry and its sub-entries to get the address range. However, not all the pages are present between the ``start'' and the ``end''. (struct vm_map_entry *node, node->start, node->end). Then I tried to get the virtual address of each page by vm_object and vm_page, but it seems nothing describing the page virtual address in these structures. Is there any way to get all the resident pages' virtual addresses in kernel? Best regards, Yue