Autogenerated GPG tag for Rusty D1ADB8F1: 15EE 8D6C AB0E 7F0C F999 BFCB D920 0E6C D1AD B8F1
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJPTq2iAAoJENkgDmzRrbjxrYEQAI9KNoASqsTd3v0R6Cnt2B78 UVRgD/fbbObqHw7uONrAxf/oh5OJWgdC05MrkifJcPjb7TNJeaYxSHgchuGLg853 kKKr2E9/laJ0+tYAmTTPKpZ11JPjIDvVAJ3Qg+WK3W+ILe2oFgzLALI9/Ilmfwj2 /fRD0HxYZRU9/vuHXa79fnHazH8VakZClqqrdVqhlRXThiGFIgGs/74s3lmjSix3 I0C/TtenpsLSKvWjUct6pLCS53xiDrxXMBDgd9SStjhjFbiAr0nIFdWekAcAZ5ln +qWP/cJY85bwzfsYPn4umynfBmmu5GSz1IMP9UZQBHaahQV2eVeKLTp3//qeTVsa 3VCTwHXFnbxnrGzC/yPhA/Vudcx6ekuH2iwLmnnOQnii+A+mDZT/pMIiNZJNpTPD cxZxiBLHEsIOixEuDXiDw93tBCT2rtTaeFRcmd52YyOLtJStFHLEwwS4udYsTM9h KkQ2r3fXEslpRV7o65Vu7fHDLEzGvKUE2bolrhwmcMvUZ1rNwegogTwPnZ2KHFxt F/wHGsmc5gOYfFk97bxGQtQE5QZ7sQHdb/zk/10awTII/YlpY/28+trz9ljbhZmD dnn62TRtlqUB4qBGguXZiUc3nTN1+WO9yVrR+hW9enHHwxmnKXeaXu1k+IErl4yV N7iypO4+PtSsxKtNqBU4 =6Q0J -----END PGP SIGNATURE----- Merge tag 'for-linus' of git://github.com/rustyrussell/linux Merge virtio pull request from Rusty Russell. * tag 'for-linus' of git://github.com/rustyrussell/linux: virtio: balloon: leak / fill balloon across S4
This commit is contained in:
commit
d7e53922aa
@ -367,29 +367,45 @@ static void __devexit virtballoon_remove(struct virtio_device *vdev)
|
||||
#ifdef CONFIG_PM
|
||||
static int virtballoon_freeze(struct virtio_device *vdev)
|
||||
{
|
||||
struct virtio_balloon *vb = vdev->priv;
|
||||
|
||||
/*
|
||||
* The kthread is already frozen by the PM core before this
|
||||
* function is called.
|
||||
*/
|
||||
|
||||
while (vb->num_pages)
|
||||
leak_balloon(vb, vb->num_pages);
|
||||
update_balloon_size(vb);
|
||||
|
||||
/* Ensure we don't get any more requests from the host */
|
||||
vdev->config->reset(vdev);
|
||||
vdev->config->del_vqs(vdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int restore_common(struct virtio_device *vdev)
|
||||
{
|
||||
struct virtio_balloon *vb = vdev->priv;
|
||||
int ret;
|
||||
|
||||
ret = init_vqs(vdev->priv);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
fill_balloon(vb, towards_target(vb));
|
||||
update_balloon_size(vb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int virtballoon_thaw(struct virtio_device *vdev)
|
||||
{
|
||||
return init_vqs(vdev->priv);
|
||||
return restore_common(vdev);
|
||||
}
|
||||
|
||||
static int virtballoon_restore(struct virtio_device *vdev)
|
||||
{
|
||||
struct virtio_balloon *vb = vdev->priv;
|
||||
struct page *page, *page2;
|
||||
|
||||
/* We're starting from a clean slate */
|
||||
vb->num_pages = 0;
|
||||
|
||||
/*
|
||||
* If a request wasn't complete at the time of freezing, this
|
||||
@ -397,12 +413,7 @@ static int virtballoon_restore(struct virtio_device *vdev)
|
||||
*/
|
||||
vb->need_stats_update = 0;
|
||||
|
||||
/* We don't have these pages in the balloon anymore! */
|
||||
list_for_each_entry_safe(page, page2, &vb->pages, lru) {
|
||||
list_del(&page->lru);
|
||||
totalram_pages++;
|
||||
}
|
||||
return init_vqs(vdev->priv);
|
||||
return restore_common(vdev);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user