All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Jim Fehlig <jfehlig@novell.com>
Cc: Olaf Hering <olaf@aepfle.de>, xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] libxc: use correct macro when unmapping memory after save operation
Date: Mon, 23 May 2011 10:16:51 +0100	[thread overview]
Message-ID: <1306142211.20576.33.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <4DD6E579.7060304@novell.com>

On Fri, 2011-05-20 at 23:04 +0100, Jim Fehlig wrote:
> With some help from Olaf, I've finally got to the bottom of an issue I
> came across while trying to implement save/restore in the libvirt
> libxenlight driver.  After issuing the save operation, the saved domain
> was not being cleaned up properly and left in this state from xl's
> perspective
> 
> xen33:# xl list
> Name                   ID   Mem VCPUs      State   Time(s)
> Domain-0                0  6821     8     r-----     122.5
> (null)                  2     2     2     --pssd      10.8
> 
> Checking the libvirtd /proc/$pid/maps I found this
> 
> 7f3798984000-7f3798b86000 r--s 00002000 00:03 4026532097 /proc/xen/privcmd
> 
> So not all all pages belonging to the domain were unmapped from
> libvirtd.  In tools/libxc/xc_domain_save.c we found that P2M_FL_ENTRIES
> were being mapped but only P2M_FLL_ENTRIES were being unmapped.  The
> attached patch changes the unmapping to use the same P2M_FL_ENTRIES
> macro.  I'm not too familiar with this code though so posting here for
> review.
> 
> I suspect this was not noticed before since most (all?) processes doing
> save terminate after the save and are not long-running like libvirtd.

Good catch!

Looks like I introduced this in 18558:ccf0205255e1, sorry!

I guess it is also wrong in the error path out of map_and_save_p2m_table
and so we also need:

diff -r 35ae855173fa tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Mon May 23 10:06:23 2011 +0100
+++ b/tools/libxc/xc_domain_save.c	Mon May 23 10:15:43 2011 +0100
@@ -861,7 +861,7 @@ static xen_pfn_t *map_and_save_p2m_table
  out:
     
     if ( !success && p2m )
-        munmap(p2m, P2M_FLL_ENTRIES * PAGE_SIZE);
+        munmap(p2m, P2M_FL_ENTRIES * PAGE_SIZE);
 
     if ( live_p2m_frame_list_list )
         munmap(live_p2m_frame_list_list, PAGE_SIZE);

  reply	other threads:[~2011-05-23  9:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20 22:04 [PATCH] libxc: use correct macro when unmapping memory after save operation Jim Fehlig
2011-05-23  9:16 ` Ian Campbell [this message]
2011-05-24 13:50   ` Ian Jackson
2011-05-24 13:58 ` Ian Jackson
2011-05-24 14:25   ` Jim Fehlig
2011-05-24 15:52     ` Keir Fraser
2011-05-24 16:18       ` Ian Jackson
2011-05-24 16:02     ` Ian Jackson

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=1306142211.20576.33.camel@zakaz.uk.xensource.com \
    --to=ian.campbell@citrix.com \
    --cc=jfehlig@novell.com \
    --cc=olaf@aepfle.de \
    --cc=xen-devel@lists.xensource.com \
    /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.