From: Cyrill Gorcunov <gorcunov@openvz.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Kees Cook <keescook@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Calvin Owens <calvinowens@fb.com>,
Alexey Dobriyan <adobriyan@gmail.com>,
Oleg Nesterov <oleg@redhat.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Al Viro <viro@zeniv.linux.org.uk>,
Peter Feiner <pfeiner@google.com>,
Pavel Emelyanov <xemul@openvz.org>
Subject: [PATCH] docs: procs -- Describe /proc/<pid>/map_files entry
Date: Tue, 27 Jan 2015 12:41:03 +0300 [thread overview]
Message-ID: <20150127094103.GK651@moon> (raw)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Kees Cook <keescook@chromium.org>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: "Kirill A. Shutemov" <kirill@shutemov.name>
CC: Calvin Owens <calvinowens@fb.com>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Oleg Nesterov <oleg@redhat.com>
CC: "Eric W. Biederman" <ebiederm@xmission.com>
CC: Al Viro <viro@zeniv.linux.org.uk>
CC: Peter Feiner <pfeiner@google.com>
CC: Pavel Emelyanov <xemul@openvz.org>
---
Gentlemen, could you please take a look once time permit.
Which questions this text raises so I could add more info
here (how we use it in criu, ptrace_may_access guards?)
Documentation/filesystems/proc.txt | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
Index: linux-2.6.git/Documentation/filesystems/proc.txt
===================================================================
--- linux-2.6.git.orig/Documentation/filesystems/proc.txt
+++ linux-2.6.git/Documentation/filesystems/proc.txt
@@ -42,6 +42,7 @@ Table of Contents
3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm
3.7 /proc/<pid>/task/<tid>/children - Information about task children
3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
+ 3.9 /proc/<pid>/map_files - Information about memory mapped files
4 Configuring procfs
4.1 Mount options
@@ -1763,6 +1764,28 @@ pair provide additional information part
with TIMER_ABSTIME option which will be shown in 'settime flags', but 'it_value'
still exhibits timer's remaining time.
+3.9 /proc/<pid>/map_files - Information about memory mapped files
+---------------------------------------------------------------------
+This directory consists of simbolic links which represent memory mapped files
+the process is carrying. A typical output is like the following
+
+ | lr-------- 1 root root 64 Jan 27 11:24 333c600000-333c620000 -> /usr/lib64/ld-2.18.so
+ | lr-------- 1 root root 64 Jan 27 11:24 333c81f000-333c820000 -> /usr/lib64/ld-2.18.so
+ | lr-------- 1 root root 64 Jan 27 11:24 333c820000-333c821000 -> /usr/lib64/ld-2.18.so
+ | ...
+ | lr-------- 1 root root 64 Jan 27 11:24 35d0421000-35d0422000 -> /usr/lib64/libselinux.so.1
+ | lr-------- 1 root root 64 Jan 27 11:24 400000-41a000 -> /usr/bin/ls
+
+The name of a link is virtual memory bounds a particular map exhibits, i.e.
+vm_area_struct::vm_start-vm_area_struct::vm_end.
+
+The main purpose of map_files directory is to be able to retrieve a set of
+memory mapped files in a fast way instead of parsing /proc/<pid>/maps or
+/proc/<pid>/smaps which contain a way more records. Same time one can open(2)
+mappings from the listings of two processes and comparing inodes figure out
+which anonymous memory areas are actually shared.
+
+
------------------------------------------------------------------------------
Configuring procfs
------------------------------------------------------------------------------
next reply other threads:[~2015-01-27 9:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-27 9:41 Cyrill Gorcunov [this message]
2015-01-27 19:50 ` [PATCH] docs: procs -- Describe /proc/<pid>/map_files entry Kees Cook
2015-01-27 20:43 ` Kirill A. Shutemov
2015-01-27 21:20 ` Cyrill Gorcunov
2015-01-30 1:31 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150127094103.GK651@moon \
--to=gorcunov@openvz.org \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=calvinowens@fb.com \
--cc=ebiederm@xmission.com \
--cc=keescook@chromium.org \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=pfeiner@google.com \
--cc=viro@zeniv.linux.org.uk \
--cc=xemul@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.