Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+22 -11
+22 -11
drivers/virtio/virtio_balloon.c
··· 367 367 #ifdef CONFIG_PM 368 368 static int virtballoon_freeze(struct virtio_device *vdev) 369 369 { 370 + struct virtio_balloon *vb = vdev->priv; 371 + 370 372 /* 371 373 * The kthread is already frozen by the PM core before this 372 374 * function is called. 373 375 */ 376 + 377 + while (vb->num_pages) 378 + leak_balloon(vb, vb->num_pages); 379 + update_balloon_size(vb); 374 380 375 381 /* Ensure we don't get any more requests from the host */ 376 382 vdev->config->reset(vdev); ··· 384 378 return 0; 385 379 } 386 380 381 + static int restore_common(struct virtio_device *vdev) 382 + { 383 + struct virtio_balloon *vb = vdev->priv; 384 + int ret; 385 + 386 + ret = init_vqs(vdev->priv); 387 + if (ret) 388 + return ret; 389 + 390 + fill_balloon(vb, towards_target(vb)); 391 + update_balloon_size(vb); 392 + return 0; 393 + } 394 + 387 395 static int virtballoon_thaw(struct virtio_device *vdev) 388 396 { 389 - return init_vqs(vdev->priv); 397 + return restore_common(vdev); 390 398 } 391 399 392 400 static int virtballoon_restore(struct virtio_device *vdev) 393 401 { 394 402 struct virtio_balloon *vb = vdev->priv; 395 - struct page *page, *page2; 396 - 397 - /* We're starting from a clean slate */ 398 - vb->num_pages = 0; 399 403 400 404 /* 401 405 * If a request wasn't complete at the time of freezing, this ··· 413 397 */ 414 398 vb->need_stats_update = 0; 415 399 416 - /* We don't have these pages in the balloon anymore! */ 417 - list_for_each_entry_safe(page, page2, &vb->pages, lru) { 418 - list_del(&page->lru); 419 - totalram_pages++; 420 - } 421 - return init_vqs(vdev->priv); 400 + return restore_common(vdev); 422 401 } 423 402 #endif 424 403