search for: kthread_run

Displaying 20 results from an estimated 129 matches for "kthread_run".

2009 Jan 19
1
[PATCH] Btrfs: check return value for kthread_run() correctly
kthread_run() returns the kthread or ERR_PTR(-ENOMEM), not NULL. Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com> --- diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 81a3138..f718d25 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1740,13 +1740,13 @@ struct btrfs_root *ope...
2015 Mar 04
2
[PATCH] virtio_balloon: set DRIVER_OK before using device
virtio spec requires that all drivers set DRIVER_OK before using devices. While balloon isn't yet included in the virtio 1 spec, previous spec versions also required this. virtio balloon might violate this rule: probe calls kthread_run before setting DRIVER_OK, which might run immediately and cause balloon to inflate/deflate. To fix, call virtio_device_ready before running the kthread. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/virtio/virtio_balloon.c | 2 ++ 1 file changed, 2 insertions(+) diff -...
2015 Mar 04
2
[PATCH] virtio_balloon: set DRIVER_OK before using device
virtio spec requires that all drivers set DRIVER_OK before using devices. While balloon isn't yet included in the virtio 1 spec, previous spec versions also required this. virtio balloon might violate this rule: probe calls kthread_run before setting DRIVER_OK, which might run immediately and cause balloon to inflate/deflate. To fix, call virtio_device_ready before running the kthread. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/virtio/virtio_balloon.c | 2 ++ 1 file changed, 2 insertions(+) diff -...
2015 Mar 05
1
[PATCH] virtio_balloon: set DRIVER_OK before using device
...: > > virtio spec requires that all drivers set DRIVER_OK > > before using devices. While balloon isn't yet > > included in the virtio 1 spec, previous spec versions > > also required this. > > > > virtio balloon might violate this rule: probe calls > > kthread_run before setting DRIVER_OK, which might run > > immediately and cause balloon to inflate/deflate. > > > > To fix, call virtio_device_ready before running the kthread. > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > Replied, CC'd stable....
2015 Mar 05
1
[PATCH] virtio_balloon: set DRIVER_OK before using device
...: > > virtio spec requires that all drivers set DRIVER_OK > > before using devices. While balloon isn't yet > > included in the virtio 1 spec, previous spec versions > > also required this. > > > > virtio balloon might violate this rule: probe calls > > kthread_run before setting DRIVER_OK, which might run > > immediately and cause balloon to inflate/deflate. > > > > To fix, call virtio_device_ready before running the kthread. > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > Replied, CC'd stable....
2015 Mar 05
0
[PATCH] virtio_balloon: set DRIVER_OK before using device
...t; <mst at redhat.com> writes: > virtio spec requires that all drivers set DRIVER_OK > before using devices. While balloon isn't yet > included in the virtio 1 spec, previous spec versions > also required this. > > virtio balloon might violate this rule: probe calls > kthread_run before setting DRIVER_OK, which might run > immediately and cause balloon to inflate/deflate. > > To fix, call virtio_device_ready before running the kthread. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> Replied, CC'd stable. Thanks, Rusty. > --- > d...
2015 Mar 05
0
[PATCH] virtio_balloon: set DRIVER_OK before using device
...t; <mst at redhat.com> writes: > virtio spec requires that all drivers set DRIVER_OK > before using devices. While balloon isn't yet > included in the virtio 1 spec, previous spec versions > also required this. > > virtio balloon might violate this rule: probe calls > kthread_run before setting DRIVER_OK, which might run > immediately and cause balloon to inflate/deflate. > > To fix, call virtio_device_ready before running the kthread. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> Replied, CC'd stable. Thanks, Rusty. > --- > d...
2009 Jan 27
13
[Patch] fix xenfb_update_screen bogus rect
Hi, When I tested pvfb, I got the following warnings. It seems to be caused by checking/setting info->dirty without dirty_lock. We need to check/set info->dirty safely. xenfb_update_screen bogus rect 2147483647 0 2147483647 0 BUG: warning at /root/linux-2.6.18-xen.hg/drivers/xen/fbfront/xenfb.c:240/xenfb_update_screen() Call Trace: [<ffffffff8036920e>] xenfb_thread+0x19b/0x2be
2014 Sep 25
2
[PATCH] virtio_balloon: Convert "vballon" kthread into a workqueue
...balloon_lock); - init_waitqueue_head(&vb->config_change); init_waitqueue_head(&vb->acked); vb->vdev = vdev; vb->need_stats_update = 0; @@ -471,11 +469,13 @@ static int virtballoon_probe(struct virtio_device *vdev) if (err) goto out_free_vb_mapping; - vb->thread = kthread_run(balloon, vb, "vballoon"); - if (IS_ERR(vb->thread)) { - err = PTR_ERR(vb->thread); + vb->wq = alloc_workqueue("vballoon_wq", + WQ_FREEZABLE | WQ_MEM_RECLAIM, 0); + if (!vb->wq) { + err = -ENOMEM; goto out_del_vqs; } + INIT_WORK(&vb->wq_work, balloon...
2014 Sep 25
2
[PATCH] virtio_balloon: Convert "vballon" kthread into a workqueue
...balloon_lock); - init_waitqueue_head(&vb->config_change); init_waitqueue_head(&vb->acked); vb->vdev = vdev; vb->need_stats_update = 0; @@ -471,11 +469,13 @@ static int virtballoon_probe(struct virtio_device *vdev) if (err) goto out_free_vb_mapping; - vb->thread = kthread_run(balloon, vb, "vballoon"); - if (IS_ERR(vb->thread)) { - err = PTR_ERR(vb->thread); + vb->wq = alloc_workqueue("vballoon_wq", + WQ_FREEZABLE | WQ_MEM_RECLAIM, 0); + if (!vb->wq) { + err = -ENOMEM; goto out_del_vqs; } + INIT_WORK(&vb->wq_work, balloon...
2008 Nov 18
0
xenfb issuing notify_remote_via_irq() too early
...t state is xenfb_probe() -> register_framebuffer() -> fbcon_event_notify() -> fbcon_fb_registered() -> fbcon_takeover() -> take_over_console() -> bind_con_driver() -> visual_init() -> fbcon_init() -> xenfb_set_par(). Since xenfb_probe() calls register_framebuffer() before kthread_run() and xenfb_connect_backend(), xenfb_thread() should find info->resize_dpy always set to 1, and hence always go into xenfb_do_resize() right away (which, depending on the timing, would perhaps find info->irq still being -1). There also is a comment right before the creation of the thread: &q...
2011 Dec 23
2
re: Btrfs: fix num_workers_starting bug and other bugs in async thread
Hi Josef, Smatch complains about this change introduces a double unlock. fs/btrfs/async-thread.c +608 find_worker(49) error: double unlock ''spin_lock:&workers->lock'' 579 spin_unlock_irqrestore(&workers->lock, flags); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ We unlock here. 580
2014 Nov 12
3
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
...p;vb->balloon_lock); - init_waitqueue_head(&vb->config_change); init_waitqueue_head(&vb->acked); vb->vdev = vdev; vb->need_stats_update = 0; @@ -443,9 +434,10 @@ static int virtballoon_probe(struct virtio_device *vdev) if (err) goto out_free_vb; - vb->thread = kthread_run(balloon, vb, "vballoon"); - if (IS_ERR(vb->thread)) { - err = PTR_ERR(vb->thread); + INIT_WORK(&vb->wq_work, balloon); + vb->wq = alloc_workqueue("vballoon_wq", WQ_FREEZABLE, 0); + if (!vb->wq) { + err = -ENOMEM; goto out_del_vqs; } @@ -476,7 +468,7 @...
2014 Nov 12
3
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
...p;vb->balloon_lock); - init_waitqueue_head(&vb->config_change); init_waitqueue_head(&vb->acked); vb->vdev = vdev; vb->need_stats_update = 0; @@ -443,9 +434,10 @@ static int virtballoon_probe(struct virtio_device *vdev) if (err) goto out_free_vb; - vb->thread = kthread_run(balloon, vb, "vballoon"); - if (IS_ERR(vb->thread)) { - err = PTR_ERR(vb->thread); + INIT_WORK(&vb->wq_work, balloon); + vb->wq = alloc_workqueue("vballoon_wq", WQ_FREEZABLE, 0); + if (!vb->wq) { + err = -ENOMEM; goto out_del_vqs; } @@ -476,7 +468,7 @...
2009 Nov 19
3
virtio: Add memory statistics reporting to the balloon driver (V3)
...e hypervisor can + * use it to signal us later. + */ + sg_init_one(&sg, vb->stats, sizeof(vb->stats)); + if (vb->stats_vq->vq_ops->add_buf(vb->stats_vq, &sg, 1, 0, vb) < 0) + BUG(); + vb->stats_vq->vq_ops->kick(vb->stats_vq); + } vb->thread = kthread_run(balloon, vb, "vballoon"); if (IS_ERR(vb->thread)) { @@ -265,7 +334,9 @@ static void virtballoon_remove(struct virtio_device *vdev) kfree(vb); } -static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST }; +static unsigned int features[] = { + VIRTIO_BALLOON_F_MUST_TELL...
2009 Nov 19
3
virtio: Add memory statistics reporting to the balloon driver (V3)
...e hypervisor can + * use it to signal us later. + */ + sg_init_one(&sg, vb->stats, sizeof(vb->stats)); + if (vb->stats_vq->vq_ops->add_buf(vb->stats_vq, &sg, 1, 0, vb) < 0) + BUG(); + vb->stats_vq->vq_ops->kick(vb->stats_vq); + } vb->thread = kthread_run(balloon, vb, "vballoon"); if (IS_ERR(vb->thread)) { @@ -265,7 +334,9 @@ static void virtballoon_remove(struct virtio_device *vdev) kfree(vb); } -static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST }; +static unsigned int features[] = { + VIRTIO_BALLOON_F_MUST_TELL...
2014 Oct 15
0
[PATCH 2/2] virtio_balloon: free some memory from balloon on OOM
...nt virtballoon_probe(struct virtio_device *vdev) if (err) goto out_free_vb; + vb->nb.notifier_call = virtballoon_oom_notify; + vb->nb.priority = VIRTBALLOON_OOM_NOTIFY_PRIORITY; + err = register_oom_notifier(&vb->nb); + if (err < 0) + goto out_oom_notify; + vb->thread = kthread_run(balloon, vb, "vballoon"); if (IS_ERR(vb->thread)) { err = PTR_ERR(vb->thread); @@ -455,6 +503,8 @@ static int virtballoon_probe(struct virtio_device *vdev) return 0; out_del_vqs: + unregister_oom_notifier(&vb->nb); +out_oom_notify: vdev->config->del_vqs(vdev...
2014 Oct 15
0
[PATCH 2/2] virtio_balloon: free some memory from balloon on OOM
...nt virtballoon_probe(struct virtio_device *vdev) if (err) goto out_free_vb; + vb->nb.notifier_call = virtballoon_oom_notify; + vb->nb.priority = VIRTBALLOON_OOM_NOTIFY_PRIORITY; + err = register_oom_notifier(&vb->nb); + if (err < 0) + goto out_oom_notify; + vb->thread = kthread_run(balloon, vb, "vballoon"); if (IS_ERR(vb->thread)) { err = PTR_ERR(vb->thread); @@ -455,6 +503,8 @@ static int virtballoon_probe(struct virtio_device *vdev) return 0; out_del_vqs: + unregister_oom_notifier(&vb->nb); +out_oom_notify: vdev->config->del_vqs(vdev...
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