From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: Re: [RFC] fs, proc: Introduce the /proc//map_files/ directory v2 Date: Wed, 24 Aug 2011 13:33:39 +0400 Message-ID: <4E54C573.10302@parallels.com> References: <20110824085329.GL29452@sun> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Cyrill Gorcunov , Nathan Lynch , Oren Laadan , Daniel Lezcano , Tejun Heo , Andrew Morton , Glauber Costa , "containers@lists.osdl.org" , "linux-kernel@vger.kernel.org" , Serge Hallyn , LINUXFS-ML , James Bottomley To: Pekka Enberg Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:18688 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756567Ab1HXJdq (ORCPT ); Wed, 24 Aug 2011 05:33:46 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 08/24/2011 01:21 PM, Pekka Enberg wrote: > On Wed, Aug 24, 2011 at 11:53 AM, Cyrill Gorcunov wrote: >> From: Pavel Emelyanov >> >> This one behaves similarly to the /proc//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 > . >