search for: towards_target

Displaying 20 results from an estimated 225 matches for "towards_target".

2015 Feb 25
2
[PATCH] virtio-balloon: do not call blocking ops when !TASK_RUNNING
virtio balloon has this code: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() || freezing(current)); Which is a problem because towards_target() call might block after wait_event_interruptible sets task state to TA...
2015 Feb 25
2
[PATCH] virtio-balloon: do not call blocking ops when !TASK_RUNNING
virtio balloon has this code: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() || freezing(current)); Which is a problem because towards_target() call might block after wait_event_interruptible sets task state to TA...
2015 Feb 25
2
[PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING
virtio balloon has this code: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() || freezing(current)); Which is a problem because towards_target() call might block after wait_event_interruptible sets task state to TA...
2015 Feb 25
2
[PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING
virtio balloon has this code: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() || freezing(current)); Which is a problem because towards_target() call might block after wait_event_interruptible sets task state to TA...
2008 Aug 18
2
[PATCH] virtio_balloon: fix towards_target when deflating balloon
...ballooning. Signed-off-by: Anthony Liguori <aliguori at us.ibm.com> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index bfef604..bd3c384 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -158,7 +158,10 @@ static inline s64 towards_target(struct virtio_balloon *vb) vb->vdev->config->get(vb->vdev, offsetof(struct virtio_balloon_config, num_pages), &v, sizeof(v)); - return v - vb->num_pages; + if (v < vb->num_pages) + return -(s64)(vb->num_pages - v); + else + return v - vb->num_p...
2008 Aug 18
2
[PATCH] virtio_balloon: fix towards_target when deflating balloon
...ballooning. Signed-off-by: Anthony Liguori <aliguori at us.ibm.com> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index bfef604..bd3c384 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -158,7 +158,10 @@ static inline s64 towards_target(struct virtio_balloon *vb) vb->vdev->config->get(vb->vdev, offsetof(struct virtio_balloon_config, num_pages), &v, sizeof(v)); - return v - vb->num_pages; + if (v < vb->num_pages) + return -(s64)(vb->num_pages - v); + else + return v - vb->num_p...
2015 Feb 26
1
virtio balloon: do not call blocking ops when !TASK_RUNNING
...ck at de.ibm.com> Subject: [PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING Message-ID: <1424874878-17155-1-git-send-email-mst at redhat.com> virtio balloon has this code: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() || freezing(current)); Which is a problem because towards_target() call might block after wait_event_interruptible sets task state to TA...
2015 Feb 26
1
virtio balloon: do not call blocking ops when !TASK_RUNNING
...ck at de.ibm.com> Subject: [PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING Message-ID: <1424874878-17155-1-git-send-email-mst at redhat.com> virtio balloon has this code: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() || freezing(current)); Which is a problem because towards_target() call might block after wait_event_interruptible sets task state to TA...
2015 Feb 25
7
virtio balloon: do not call blocking ops when !TASK_RUNNING
...9773] Last Breaking-Event-Address: [ 0.839776] [<000000000015bf8a>] __might_sleep+0x8a/0x98 [ 0.839778] ---[ end trace d27fcdfa27273d7c ]--- The problem seems to be this code in balloon() in drivers/virtio/virtio_balloon.c: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() || freezing(current)); wait_event_interruptible() sets the state of the current task to TASK_INTERRUPTIBLE, then checks the condition. The condition contains towards_target() which reads the virtio config space via virti...
2015 Feb 25
7
virtio balloon: do not call blocking ops when !TASK_RUNNING
...9773] Last Breaking-Event-Address: [ 0.839776] [<000000000015bf8a>] __might_sleep+0x8a/0x98 [ 0.839778] ---[ end trace d27fcdfa27273d7c ]--- The problem seems to be this code in balloon() in drivers/virtio/virtio_balloon.c: wait_event_interruptible(vb->config_change, (diff = towards_target(vb)) != 0 || vb->need_stats_update || kthread_should_stop() || freezing(current)); wait_event_interruptible() sets the state of the current task to TASK_INTERRUPTIBLE, then checks the condition. The condition contains towards_target() which reads the virtio config space via virti...
2015 Feb 25
0
[PATCH] virtio-balloon: do not call blocking ops when !TASK_RUNNING
On Wed, 25 Feb 2015 15:14:36 +0100 "Michael S. Tsirkin" <mst at redhat.com> wrote: > virtio balloon has this code: > wait_event_interruptible(vb->config_change, > (diff = towards_target(vb)) != 0 > || vb->need_stats_update > || kthread_should_stop() > || freezing(current)); > > Which is a problem because towards_target() call might block after > wait_event_inter...
2015 Feb 25
0
[PATCH] virtio-balloon: do not call blocking ops when !TASK_RUNNING
On Wed, 25 Feb 2015 15:14:36 +0100 "Michael S. Tsirkin" <mst at redhat.com> wrote: > virtio balloon has this code: > wait_event_interruptible(vb->config_change, > (diff = towards_target(vb)) != 0 > || vb->need_stats_update > || kthread_should_stop() > || freezing(current)); > > Which is a problem because towards_target() call might block after > wait_event_inter...
2015 Dec 04
4
[PATCH v4 0/2] virtio_balloon: Fix restore and convert to workqueue
It has been long since I have sent v3 of the balloon conversion from a kthread to a workqueue. I have gained some more experience with the APIs in the meantime. I hope that you would like the outcome. I have added one more patch that fixes a separate problem with restoring the balloon after the system freeze. I have found this when testing the conversion. Changes against v3: + rebased on
2015 Dec 04
4
[PATCH v4 0/2] virtio_balloon: Fix restore and convert to workqueue
It has been long since I have sent v3 of the balloon conversion from a kthread to a workqueue. I have gained some more experience with the APIs in the meantime. I hope that you would like the outcome. I have added one more patch that fixes a separate problem with restoring the balloon after the system freeze. I have found this when testing the conversion. Changes against v3: + rebased on
2015 Feb 25
1
[PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING
...ck at de.ibm.com> wrote: > On Wed, 25 Feb 2015 15:36:02 +0100 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > virtio balloon has this code: > > wait_event_interruptible(vb->config_change, > > (diff = towards_target(vb)) != 0 > > || vb->need_stats_update > > || kthread_should_stop() > > || freezing(current)); > > > > Which is a problem because towards_target() call might block af...
2015 Feb 25
1
[PATCH v2] virtio-balloon: do not call blocking ops when !TASK_RUNNING
...ck at de.ibm.com> wrote: > On Wed, 25 Feb 2015 15:36:02 +0100 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > virtio balloon has this code: > > wait_event_interruptible(vb->config_change, > > (diff = towards_target(vb)) != 0 > > || vb->need_stats_update > > || kthread_should_stop() > > || freezing(current)); > > > > Which is a problem because towards_target() call might block af...
2023 Aug 29
2
[PATCH] virtio_balloon: Fix endless deflation and inflation on arm64
...e_request(struct virtio_balloon *vb) virtqueue_kick(vq); } +static inline s64 align_pages_up(s64 diff) +{ + if (diff == 0) + return diff; + + if (diff > 0) + return ALIGN(diff, VIRTIO_BALLOON_PAGES_PER_PAGE); + + return -ALIGN(-diff, VIRTIO_BALLOON_PAGES_PER_PAGE); +} + static inline s64 towards_target(struct virtio_balloon *vb) { s64 target; @@ -396,7 +407,7 @@ static inline s64 towards_target(struct virtio_balloon *vb) &num_pages); target = num_pages; - return target - vb->num_pages; + return align_pages_up(target - vb->num_pages); } /* Gives back @num_to_return blocks...
2016 Jan 01
1
[PATCH v4 1/2] virtio_balloon: Restore the entire balloon after the system freeze
...*vdev) > { > struct virtio_balloon *vb = vdev->priv; > + s64 diff; > int ret; > > ret = init_vqs(vdev->priv); > @@ -589,7 +594,9 @@ static int virtballoon_restore(struct virtio_device *vdev) > > virtio_device_ready(vdev); > > - fill_balloon(vb, towards_target(vb)); > + diff = towards_target(vb); > + while (diff > 0) > + diff -= fill_balloon(vb, diff); > update_balloon_size(vb); > return 0; > } > -- > 1.8.5.6
2016 Jan 01
1
[PATCH v4 1/2] virtio_balloon: Restore the entire balloon after the system freeze
...*vdev) > { > struct virtio_balloon *vb = vdev->priv; > + s64 diff; > int ret; > > ret = init_vqs(vdev->priv); > @@ -589,7 +594,9 @@ static int virtballoon_restore(struct virtio_device *vdev) > > virtio_device_ready(vdev); > > - fill_balloon(vb, towards_target(vb)); > + diff = towards_target(vb); > + while (diff > 0) > + diff -= fill_balloon(vb, diff); > update_balloon_size(vb); > return 0; > } > -- > 1.8.5.6
2015 Feb 26
0
virtio balloon: do not call blocking ops when !TASK_RUNNING
...; [ 0.839776] [<000000000015bf8a>] __might_sleep+0x8a/0x98 > [ 0.839778] ---[ end trace d27fcdfa27273d7c ]--- > > The problem seems to be this code in balloon() in > drivers/virtio/virtio_balloon.c: > > wait_event_interruptible(vb->config_change, > (diff = towards_target(vb)) != 0 > || vb->need_stats_update > || kthread_should_stop() > || freezing(current)); > > wait_event_interruptible() sets the state of the current task to > TASK_INTERRUPTIBLE, then checks the condition. The condition contains > towards_target() which reads...