Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252944
b: refs/heads/master
c: bf50e69
h: refs/heads/master
v: v3
  • Loading branch information
Dave Hansen authored and Rusty Russell committed May 30, 2011
1 parent 83fff78 commit 0772d7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 177dbd95637a52b9118aca757d5856ec3995d3e7
refs/heads/master: bf50e69f63d21091e525185c3ae761412be0ba72
21 changes: 8 additions & 13 deletions trunk/drivers/virtio/virtio_balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ struct virtio_balloon
/* Waiting for host to ack the pages we released. */
struct completion acked;

/* Do we have to tell Host *before* we reuse pages? */
bool tell_host_first;

/* The pages we've told the Host we're not using. */
unsigned int num_pages;
struct list_head pages;
Expand Down Expand Up @@ -151,13 +148,14 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
vb->num_pages--;
}

if (vb->tell_host_first) {
tell_host(vb, vb->deflate_vq);
release_pages_by_pfn(vb->pfns, vb->num_pfns);
} else {
release_pages_by_pfn(vb->pfns, vb->num_pfns);
tell_host(vb, vb->deflate_vq);
}

/*
* Note that if
* virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST);
* is true, we *have* to do it in this order
*/
tell_host(vb, vb->deflate_vq);
release_pages_by_pfn(vb->pfns, vb->num_pfns);
}

static inline void update_stat(struct virtio_balloon *vb, int idx,
Expand Down Expand Up @@ -325,9 +323,6 @@ static int virtballoon_probe(struct virtio_device *vdev)
goto out_del_vqs;
}

vb->tell_host_first
= virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST);

return 0;

out_del_vqs:
Expand Down

0 comments on commit 0772d7f

Please sign in to comment.