Displaying 20 results from an estimated 405 matches for "queue_work".
2018 Jan 19
3
[PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...just retry later - hopefully after getting an
> > interrupt?
> >
> > Alternatively, stop adding more entries when we have a single
> > ring entry left, making sure we have space for the command.
>
> I think the second one looks good. Thanks.
>
> > > + queue_work(system_freezable_wq,
> > > + &vb->update_balloon_size_work);
> > > + spin_unlock_irqrestore(&vb->stop_update_lock, flags);
> > > + }
> > > +
> > > + virtio_cread(vb->vdev, struct virtio_balloon_config,
> > > + free_...
2018 Jan 24
1
[virtio-dev] Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...Fri, Jan 19, 2018 at 11:44:21AM +0800, Wei Wang wrote:
>>> On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote:
>>>> On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote:
>>>>
>>>>> + vb->start_cmd_id = cmd_id;
>>>>> + queue_work(vb->balloon_wq, &vb->report_free_page_work);
>>>> It seems that if a command was already queued (with a different id),
>>>> this will result in new command id being sent to host twice, which
>>>> will
>>>> likely confuse the host.
>>&...
2018 Jan 24
1
[virtio-dev] Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...Jan 19, 2018 at 11:44:21AM +0800, Wei Wang wrote:
> > > On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote:
> > > > On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote:
> > > >
> > > > > + vb->start_cmd_id = cmd_id;
> > > > > + queue_work(vb->balloon_wq, &vb->report_free_page_work);
> > > > It seems that if a command was already queued (with a different id),
> > > > this will result in new command id being sent to host twice, which will
> > > > likely confuse the host.
> > > I t...
2019 Jan 03
6
[PATCH v1 0/2] virtio-balloon: tweak config_changed
Since virtio-ccw doesn't work with accessing to the config registers
inside an interrupt context, this patch series avoids that issue by
moving the config register accesses to the related workqueue contexts.
Wei Wang (2):
virtio-balloon: tweak config_changed implementation
virtio-balloon: improve update_balloon_size_func
drivers/virtio/virtio_balloon.c | 59
2019 Jan 04
4
[PATCH v2 0/2] virtio-balloon: tweak config_changed
Since virtio-ccw doesn't work with accessing to the config space
inside an interrupt context, this patch series avoids that issue by
moving the config register accesses to the related workqueue contexts.
v1->v2 ChangeLog:
- add config_read_bitmap to indicate to the workqueue callbacks about
the necessity of reading the related config fields.
Wei Wang (2):
virtio-balloon: tweak
2019 Jan 03
1
[PATCH v1 1/2] virtio-balloon: tweak config_changed implementation
...balloon_changed(struct virtio_device *vdev)
> {
> struct virtio_balloon *vb = vdev->priv;
> unsigned long flags;
> - s64 diff = towards_target(vb);
> -
> - if (diff) {
> - spin_lock_irqsave(&vb->stop_update_lock, flags);
> - if (!vb->stop_update)
> - queue_work(system_freezable_wq,
> - &vb->update_balloon_size_work);
> - spin_unlock_irqrestore(&vb->stop_update_lock, flags);
> - }
>
> - if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
> - virtio_cread(vdev, struct virtio_balloon_config,
> -...
2018 Jan 22
0
[virtio-dev] Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...chael S. Tsirkin wrote:
> On Fri, Jan 19, 2018 at 11:44:21AM +0800, Wei Wang wrote:
>> On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote:
>>> On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote:
>>>
>>>> + vb->start_cmd_id = cmd_id;
>>>> + queue_work(vb->balloon_wq, &vb->report_free_page_work);
>>> It seems that if a command was already queued (with a different id),
>>> this will result in new command id being sent to host twice, which will
>>> likely confuse the host.
>> I think that case won't ha...
2019 Jan 03
0
[PATCH v1 1/2] virtio-balloon: tweak config_changed implementation
...loon.c
@@ -394,33 +394,15 @@ static void virtballoon_changed(struct virtio_device *vdev)
{
struct virtio_balloon *vb = vdev->priv;
unsigned long flags;
- s64 diff = towards_target(vb);
-
- if (diff) {
- spin_lock_irqsave(&vb->stop_update_lock, flags);
- if (!vb->stop_update)
- queue_work(system_freezable_wq,
- &vb->update_balloon_size_work);
- spin_unlock_irqrestore(&vb->stop_update_lock, flags);
- }
- if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
- virtio_cread(vdev, struct virtio_balloon_config,
- free_page_report_cmd_id, &vb-...
2014 Sep 25
2
[PATCH] virtio_balloon: Convert "vballon" kthread into a workqueue
...;
+ done = false;
break;
}
set_page_pfns(vb->pfns + vb->num_pfns, page);
@@ -154,6 +155,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
if (vb->num_pfns != 0)
tell_host(vb, vb->inflate_vq);
mutex_unlock(&vb->balloon_lock);
+
+ if (!done)
+ queue_work(vb->wq, &vb->wq_work);
}
static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
@@ -168,20 +172,25 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
}
}
-static void leak_balloon(struct virtio_balloon *vb, size_t num)
+static void leak_balloon(...
2014 Sep 25
2
[PATCH] virtio_balloon: Convert "vballon" kthread into a workqueue
...;
+ done = false;
break;
}
set_page_pfns(vb->pfns + vb->num_pfns, page);
@@ -154,6 +155,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
if (vb->num_pfns != 0)
tell_host(vb, vb->inflate_vq);
mutex_unlock(&vb->balloon_lock);
+
+ if (!done)
+ queue_work(vb->wq, &vb->wq_work);
}
static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
@@ -168,20 +172,25 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
}
}
-static void leak_balloon(struct virtio_balloon *vb, size_t num)
+static void leak_balloon(...
2019 Jan 04
0
[PATCH v2 1/2] virtio-balloon: tweak config_changed implementation
...e_work(struct virtio_balloon *vb)
+{
+ if (!virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT))
+ return;
+
+ /* No need to queue the work if the bit was already set. */
+ if (test_and_set_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
+ &vb->config_read_bitmap))
+ return;
+
+ queue_work(vb->balloon_wq, &vb->report_free_page_work);
+}
+
static void virtballoon_changed(struct virtio_device *vdev)
{
struct virtio_balloon *vb = vdev->priv;
unsigned long flags;
- s64 diff = towards_target(vb);
-
- if (diff) {
- spin_lock_irqsave(&vb->stop_update_lock, flags);...
2014 Nov 12
3
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
...struct page *page = balloon_page_enqueue(vb_dev_info);
@@ -153,6 +151,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
/* Did we get any? */
if (vb->num_pfns != 0)
tell_host(vb, vb->inflate_vq);
+ /* Do we need to get more? */
+ if (vb->num_pfns < num)
+ queue_work(vb->wq, &vb->wq_work);
mutex_unlock(&vb->balloon_lock);
}
@@ -172,12 +173,13 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
{
struct page *page;
struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info;
+ size_t limit;
/* We can only do one a...
2014 Nov 12
3
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
...struct page *page = balloon_page_enqueue(vb_dev_info);
@@ -153,6 +151,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
/* Did we get any? */
if (vb->num_pfns != 0)
tell_host(vb, vb->inflate_vq);
+ /* Do we need to get more? */
+ if (vb->num_pfns < num)
+ queue_work(vb->wq, &vb->wq_work);
mutex_unlock(&vb->balloon_lock);
}
@@ -172,12 +173,13 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
{
struct page *page;
struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info;
+ size_t limit;
/* We can only do one a...
2018 Jan 17
3
[PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...virtqueue_kick(vq);
> }
>
> -static void virtballoon_changed(struct virtio_device *vdev)
> -{
> - struct virtio_balloon *vb = vdev->priv;
> - unsigned long flags;
> -
> - spin_lock_irqsave(&vb->stop_update_lock, flags);
> - if (!vb->stop_update)
> - queue_work(system_freezable_wq, &vb->update_balloon_size_work);
> - spin_unlock_irqrestore(&vb->stop_update_lock, flags);
> -}
> -
> static inline s64 towards_target(struct virtio_balloon *vb)
> {
> s64 target;
> @@ -343,6 +409,36 @@ static inline s64 towards_target(stru...
2018 Jan 17
3
[PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ
...virtqueue_kick(vq);
> }
>
> -static void virtballoon_changed(struct virtio_device *vdev)
> -{
> - struct virtio_balloon *vb = vdev->priv;
> - unsigned long flags;
> -
> - spin_lock_irqsave(&vb->stop_update_lock, flags);
> - if (!vb->stop_update)
> - queue_work(system_freezable_wq, &vb->update_balloon_size_work);
> - spin_unlock_irqrestore(&vb->stop_update_lock, flags);
> -}
> -
> static inline s64 towards_target(struct virtio_balloon *vb)
> {
> s64 target;
> @@ -343,6 +409,36 @@ static inline s64 towards_target(stru...
2016 Jan 25
2
[PATCH v5 0/2] virtio_balloon: Conversion to workqueue + parallel stats
The previous version did not prevent updating the balloon when it was
being removed. There was an idea to update the stats in a separate work
and cancel it after the config reset. But this does not seem to work.
The code for updating the stats communicates with the host. IMHO, it
should not run after the reset (flushing buffers). Therefore I decided
to use a boolean value and a spin lock (inspired
2016 Jan 25
2
[PATCH v5 0/2] virtio_balloon: Conversion to workqueue + parallel stats
The previous version did not prevent updating the balloon when it was
being removed. There was an idea to update the stats in a separate work
and cancel it after the config reset. But this does not seem to work.
The code for updating the stats communicates with the host. IMHO, it
should not run after the reset (flushing buffers). Therefore I decided
to use a boolean value and a spin lock (inspired
2014 Nov 20
2
[PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue
On Thu, Nov 20, 2014 at 06:47:11PM +0200, Michael S. Tsirkin wrote:
> > There's cancel_work_sync() to stop the self-requeueing ones.
>
> What happens if queue_work runs while cancel_work_sync is in progress?
> Does it fail to queue?
cancel_work_sync() is guaranteed to take self-requeueing work items no
matter when it's called or what's going on. External (non-self)
queueings of course should be stopped in other ways.
> > > From that POV...
2014 Nov 20
2
[PATCH v3] virtio_balloon: Convert "vballoon" kthread into a workqueue
On Thu, Nov 20, 2014 at 06:47:11PM +0200, Michael S. Tsirkin wrote:
> > There's cancel_work_sync() to stop the self-requeueing ones.
>
> What happens if queue_work runs while cancel_work_sync is in progress?
> Does it fail to queue?
cancel_work_sync() is guaranteed to take self-requeueing work items no
matter when it's called or what's going on. External (non-self)
queueings of course should be stopped in other ways.
> > > From that POV...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...virtqueue_kick(vq);
> }
>
> -static void virtballoon_changed(struct virtio_device *vdev)
> -{
> - struct virtio_balloon *vb = vdev->priv;
> - unsigned long flags;
> -
> - spin_lock_irqsave(&vb->stop_update_lock, flags);
> - if (!vb->stop_update)
> - queue_work(system_freezable_wq, &vb->update_balloon_size_work);
> - spin_unlock_irqrestore(&vb->stop_update_lock, flags);
> -}
> -
> static inline s64 towards_target(struct virtio_balloon *vb)
> {
> s64 target;
> @@ -353,6 +369,35 @@ static inline s64 towards_target(stru...