[CRIU] [PATCH 04/13] mem: Add read_pme helper

Cyrill Gorcunov gorcunov at openvz.org
Thu May 23 07:20:38 EDT 2013


On Thu, May 23, 2013 at 03:02:18PM +0400, Pavel Emelyanov wrote:
> On 05/22/2013 11:09 PM, Cyrill Gorcunov wrote:
> > 
> > Will need it to compare page frame number of vdso areas.
> > 
> > Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> > ---
> >  include/mem.h |  3 +++
> >  mem.c         | 29 +++++++++++++++++++++++++++++
> >  2 files changed, 32 insertions(+)
> > 
> > +int read_pme(pid_t pid, unsigned long addr, u64 *pme)
> > +{
> > +	int fd, ret = -1;
> > +	char path[32];
> > +	off_t off;
> > +
> > +	snprintf(path, sizeof(path), "/proc/%d/pagemap", pid);
> 
> Can we use existing open_proc helper?

Yeah, open proc should work here as well, will update.

> 
> > +	fd = open(path, O_RDONLY);
> 
> Can we open this file once during parasite_fixup_vdso()?

Yeah, we can. this speed up code a bit, will update.


More information about the CRIU mailing list