Skip to contentSkip to conversation

fs-backend: fix gnttab unmap

PATCH In review Stefano Stabellini 2 participants 3 messages Mar 19, 2009 – Mar 23, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs-backend: fix gnttab unmap

Hi all,
when a stubdom is destroyed, fs-backend does not correctly unmap all the pages mapped for the shared ring.
This causes some pages not to be properly freed by xen, hence after a cycle of 50 save\restore we don't have enough spare memory to start 2 VMs any more.
This patch fixes the issue properly unmapping all the pages needed by the shared ring.

---

tools/fs-back/fs-backend.c +1 -1
diff -r 633e08774dab tools/fs-back/fs-backend.c
@@ -161,7 +161,7 @@
     while (!xenbus_frontend_state_changed(mount, STATE_CLOSING));
     xenbus_write_backend_state(mount, STATE_CLOSED);
 
-    xc_gnttab_munmap(mount->gnth, mount->ring.sring, 1);
+    xc_gnttab_munmap(mount->gnth, mount->ring.sring, mount->shared_ring_size);
     xc_gnttab_close(mount->gnth);
     xc_evtchn_unbind(mount->evth, mount->local_evtchn);
     xc_evtchn_close(mount->evth);
#1 lore raw
Quoted 9 lines · Stefano Stabellini

Hi all,
when a stubdom is destroyed, fs-backend does not correctly unmap all the pages mapped for the shared ring.
This causes some pages not to be properly freed by xen, hence after a cycle of 50 save\restore we don't have enough spare memory to start 2 VMs any more.
This patch fixes the issue properly unmapping all the pages needed by the shared ring.

I can confirm that fs-backend is more stable. I have performed hundreds of save/restore cycles without issue.

Keith Coleman

#2 lore raw
Quoted 12 lines · Keith Coleman
Quoted 9 lines · Stefano Stabellini

Hi all,
when a stubdom is destroyed, fs-backend does not correctly unmap all the pages mapped for the shared ring.
This causes some pages not to be properly freed by xen, hence after a cycle of 50 save\restore we don't have enough spare memory to start 2 VMs any more.
This patch fixes the issue properly unmapping all the pages needed by the shared ring.

Quoted 3 lines

I can confirm that fs-backend is more stable. I have performed hundreds of save/restore cycles without issue.

good, thanks again for testing.