Displaying 20 results from an estimated 151 matches for "kthread_should_stop".
2009 Sep 03
2
[PATCH] Don't exist from cleaner_kthread and transaction_kthread until kthread_should_stop is true
upstream commit 2ad49887150894b9ed6a87a76b409adceee6b074
Motivated from the commit,
I found that cleaner_kthread() and transaction_kthread()
can result similar error since these two function can exit
even though kthread_should_stop() is not true.
In order to resolve the bug, break statements are changed
into continue statements in order to wait until kthread_should_stop()
becomes true.
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
--- a/fs/btrfs/disk-io.c 2009-08-17 06:19:38.000000000 +0900
+++ a/fs/btrfs/...
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 TAST_INTERRUPTIBLE, causing
the task_struct::state collision typical of nesting of sleeping
primitives
See also http://lwn.net/A...
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 TAST_INTERRUPTIBLE, causing
the task_struct::state collision typical of nesting of sleeping
primitives
See also http://lwn.net/A...
2015 Feb 26
1
virtio balloon: do not call blocking ops when !TASK_RUNNING
...74878-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 TAST_INTERRUPTIBLE, causing
the task_struct::state collision typical of nesting of sleeping
primitives
See also http://lwn.net/A...
2015 Feb 26
1
virtio balloon: do not call blocking ops when !TASK_RUNNING
...74878-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 TAST_INTERRUPTIBLE, causing
the task_struct::state collision typical of nesting of sleeping
primitives
See also http://lwn.net/A...
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 TAST_INTERRUPTIBLE, causing
the task_struct::state collision typical of nesting of sleeping
primitives
See also http://lwn.net/A...
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 TAST_INTERRUPTIBLE, causing
the task_struct::state collision typical of nesting of sleeping
primitives
See also http://lwn.net/A...
2015 Feb 25
0
[PATCH] virtio-balloon: do not call blocking ops when !TASK_RUNNING
...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_interruptible sets task state to TAST_INTERRUPTIBLE, causing
> the task_struct::state collision typical of nesting of sleeping
> primiti...
2015 Feb 25
0
[PATCH] virtio-balloon: do not call blocking ops when !TASK_RUNNING
...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_interruptible sets task state to TAST_INTERRUPTIBLE, causing
> the task_struct::state collision typical of nesting of sleeping
> primiti...
2015 Feb 26
2
virtio balloon: do not call blocking ops when !TASK_RUNNING
On Thu, Feb 26, 2015 at 11:50:42AM +1030, Rusty Russell wrote:
> Thomas Huth <thuth at linux.vnet.ibm.com> writes:
> > Hi all,
> >
> > with the recent kernel 3.19, I get a kernel warning when I start my
> > KVM guest on s390 with virtio balloon enabled:
>
> The deeper problem is that virtio_ccw_get_config just silently fails on
> OOM.
>
> Neither
2015 Feb 26
2
virtio balloon: do not call blocking ops when !TASK_RUNNING
On Thu, Feb 26, 2015 at 11:50:42AM +1030, Rusty Russell wrote:
> Thomas Huth <thuth at linux.vnet.ibm.com> writes:
> > Hi all,
> >
> > with the recent kernel 3.19, I get a kernel warning when I start my
> > KVM guest on s390 with virtio balloon enabled:
>
> The deeper problem is that virtio_ccw_get_config just silently fails on
> OOM.
>
> Neither
2010 May 05
5
[Pv-ops][PATCH 0/4 v4] Netback multiple threads support
....
3. Use vmalloc to allocate netbk structures.
Main Changes from v2:
1. Merge "group" and "idx" into "netif->mapping", therefore
page_ext is not used now.
2. Put netbk_add_netif() and netbk_remove_netif() into
__netif_up() and __netif_down().
3. Change the usage of kthread_should_stop().
4. Use __get_free_pages() to replace kzalloc().
5. Modify the changes to netif_be_dbg().
6. Use MODPARM_netback_kthread to determine whether using
tasklet or kernel thread.
7. Put small fields in the front, and large arrays in the end of struct
xen_netbk.
8. Add more checks in netif_page_release...
2009 Apr 17
1
virtio-balloon: check for freezer in kthread loop
.../virtio_balloon.c
index 5926826..9c76a06 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -190,7 +190,8 @@ static int balloon(void *_vballoon)
try_to_freeze();
wait_event_interruptible(vb->config_change,
(diff = towards_target(vb)) != 0
- || kthread_should_stop());
+ || kthread_should_stop()
+ || freezing(current));
if (diff > 0)
fill_balloon(vb, diff);
else if (diff < 0)
2009 Apr 17
1
virtio-balloon: check for freezer in kthread loop
.../virtio_balloon.c
index 5926826..9c76a06 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -190,7 +190,8 @@ static int balloon(void *_vballoon)
try_to_freeze();
wait_event_interruptible(vb->config_change,
(diff = towards_target(vb)) != 0
- || kthread_should_stop());
+ || kthread_should_stop()
+ || freezing(current));
if (diff > 0)
fill_balloon(vb, diff);
else if (diff < 0)
2015 Feb 25
1
[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 TAST_INTERRUPTIBLE, causing
> > the task_struct::state collision typical of nesting...
2015 Feb 25
1
[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 TAST_INTERRUPTIBLE, causing
> > the task_struct::state collision typical of nesting...
2020 Mar 18
4
[PATCH 1/9] drm/vblank: Add vblank works
....thread);
> }
>
> kfree(dev->vblank);
> @@ -447,6 +453,108 @@ void drm_vblank_cleanup(struct drm_device *dev)
> dev->num_crtcs = 0;
> }
>
> +static int vblank_work_thread(void *data)
> +{
> + struct drm_vblank_crtc *vblank = data;
> +
> + while (!kthread_should_stop()) {
> + struct drm_vblank_work *work, *next;
> + LIST_HEAD(list);
> + u64 count;
> + int ret;
> +
> + spin_lock_irq(&vblank->dev->event_lock);
> +
> + ret = wait_event_interruptible_lock_irq(vblank->queue,
> + kthread_should_stop() ||
> +...
2015 Feb 25
7
virtio balloon: do not call blocking ops when !TASK_RUNNING
...15bf8a>] __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 virtio_cread().
On s390, this then triggers virtio_ccw_get_config() - and th...
2015 Feb 25
7
virtio balloon: do not call blocking ops when !TASK_RUNNING
...15bf8a>] __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 virtio_cread().
On s390, this then triggers virtio_ccw_get_config() - and th...
2014 Nov 12
3
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
...rget(struct virtio_balloon *vb)
@@ -287,35 +292,22 @@ static void update_balloon_size(struct virtio_balloon *vb)
&actual);
}
-static int balloon(void *_vballoon)
+static void balloon(struct work_struct *work)
{
- struct virtio_balloon *vb = _vballoon;
-
- set_freezable();
- while (!kthread_should_stop()) {
- s64 diff;
-
- try_to_freeze();
- wait_event_interruptible(vb->config_change,
- (diff = towards_target(vb)) != 0
- || vb->need_stats_update
- || kthread_should_stop()
- || freezing(current));
- if (vb->need_stats_update)
- stats_handle_request(vb);
- if (di...