[RFC] fs, proc: Introduce the /proc/<pid>/map_files/ directory v2

Pavel Emelyanov xemul at parallels.com
Wed Aug 24 02:33:39 PDT 2011

On 08/24/2011 01:21 PM, Pekka Enberg wrote:
> On Wed, Aug 24, 2011 at 11:53 AM, Cyrill Gorcunov <gorcunov at gmail.com> wrote:
>> From: Pavel Emelyanov <xemul at parallels.com>
>> This one behaves similarly to the /proc/<pid>/fd/ one - it contains symlinks
>> one for each mapping with file, the name of a symlink is vma->vm_start, the
>> target is the file. Opening a symlink results in a file that point exactly
>> to the same inode as them vma's one.
>> This thing is aimed to help checkpointing processes.
> OK, but you really should explain _how_ this will help with checkpointing.

This helps in three ways:

1. When dumping a task mappings we do know exact file that is mapped by particular
   region. We do this by opening /proc/pid/map_files/address symlink the way we do
   with file descriptors.
2. This also helps in determining which anonymous shared mappings are shared with
   each other by comparing the inodes of them.

3. When restoring a set of process in case two of them has a mapping shared, we map
   the memory by the 1st one and then open its /proc/pid/map_files/address file and
   map it by the 2nd task.

>                         Pekka
> .

More information about the Containers mailing list