search for: wait_queue_head_t

Displaying 20 results from an estimated 705 matches for "wait_queue_head_t".

2016 Apr 27
2
[PATCH] vhost_net: stop polling socket during rx processing
...though. ---> wait: add API to drop a wait_queue_t entry from wake up handler A wake up handler might want to remove its own wait queue entry to avoid future wakeups. In particular, vhost has such a need. As wait queue lock is already taken, all we need is an API to remove the entry without wait_queue_head_t which isn't currently accessible to wake up handlers. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- diff --git a/include/linux/wait.h b/include/linux/wait.h index 27d7a0a..9c6604b 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -191,11 +191,17 @@ __add_wait_...
2016 Apr 27
2
[PATCH] vhost_net: stop polling socket during rx processing
...though. ---> wait: add API to drop a wait_queue_t entry from wake up handler A wake up handler might want to remove its own wait queue entry to avoid future wakeups. In particular, vhost has such a need. As wait queue lock is already taken, all we need is an API to remove the entry without wait_queue_head_t which isn't currently accessible to wake up handlers. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- diff --git a/include/linux/wait.h b/include/linux/wait.h index 27d7a0a..9c6604b 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -191,11 +191,17 @@ __add_wait_...
2016 Apr 28
0
[PATCH] vhost_net: stop polling socket during rx processing
...add API to drop a wait_queue_t entry from wake up handler > > A wake up handler might want to remove its own wait queue entry to avoid > future wakeups. In particular, vhost has such a need. As wait queue > lock is already taken, all we need is an API to remove the entry without > wait_queue_head_t which isn't currently accessible to wake up handlers. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > --- > > diff --git a/include/linux/wait.h b/include/linux/wait.h > index 27d7a0a..9c6604b 100644 > --- a/include/linux/wait.h > +++ b/include/linu...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...-#include <linux/virtio_config.h> -#include <linux/virtio_ring.h> -#include <linux/atomic.h> - -struct vhost_work; -typedef void (*vhost_work_fn_t)(struct vhost_work *work); - -#define VHOST_WORK_QUEUED 1 -struct vhost_work { - struct llist_node node; - vhost_work_fn_t fn; - wait_queue_head_t done; - int flushing; - unsigned queue_seq; - unsigned done_seq; - unsigned long flags; -}; - -/* Poll a file (eventfd or socket) */ -/* Note: there's nothing vhost specific about this structure. */ -struct vhost_poll { - poll_table table; - wait_queue_head_t...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...-#include <linux/virtio_config.h> -#include <linux/virtio_ring.h> -#include <linux/atomic.h> - -struct vhost_work; -typedef void (*vhost_work_fn_t)(struct vhost_work *work); - -#define VHOST_WORK_QUEUED 1 -struct vhost_work { - struct llist_node node; - vhost_work_fn_t fn; - wait_queue_head_t done; - int flushing; - unsigned queue_seq; - unsigned done_seq; - unsigned long flags; -}; - -/* Poll a file (eventfd or socket) */ -/* Note: there's nothing vhost specific about this structure. */ -struct vhost_poll { - poll_table table; - wait_queue_head_t...
2017 Jul 12
2
[PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG
...ed int head, > + bool indirect, > + struct vring_desc *indirect_desc, > + void *data, > + void *ctx); > + > bool virtqueue_kick(struct virtqueue *vq); > > +bool virtqueue_kick_sync(struct virtqueue *vq); > + > +bool virtqueue_kick_async(struct virtqueue *vq, wait_queue_head_t wq); > + > bool virtqueue_kick_prepare(struct virtqueue *vq); > > bool virtqueue_notify(struct virtqueue *vq); I don't much care for this API. It does exactly what balloon needs, but at cost of e.g. transparently busy-waiting. Unlikely to be a good fit for anything else. If yo...
2017 Jul 12
2
[PATCH v12 5/8] virtio-balloon: VIRTIO_BALLOON_F_SG
...ed int head, > + bool indirect, > + struct vring_desc *indirect_desc, > + void *data, > + void *ctx); > + > bool virtqueue_kick(struct virtqueue *vq); > > +bool virtqueue_kick_sync(struct virtqueue *vq); > + > +bool virtqueue_kick_async(struct virtqueue *vq, wait_queue_head_t wq); > + > bool virtqueue_kick_prepare(struct virtqueue *vq); > > bool virtqueue_notify(struct virtqueue *vq); I don't much care for this API. It does exactly what balloon needs, but at cost of e.g. transparently busy-waiting. Unlikely to be a good fit for anything else. If yo...
2017 Mar 10
0
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...<linux/virtio_ring.h> > -#include <linux/atomic.h> > - > -struct vhost_work; > -typedef void (*vhost_work_fn_t)(struct vhost_work *work); > - > -#define VHOST_WORK_QUEUED 1 > -struct vhost_work { > - struct llist_node node; > - vhost_work_fn_t fn; > - wait_queue_head_t done; > - int flushing; > - unsigned queue_seq; > - unsigned done_seq; > - unsigned long flags; > -}; > - > -/* Poll a file (eventfd or socket) */ > -/* Note: there's nothing vhost specific about this structure. */ > -struct vhost_poll { > - poll_tab...
2018 Jan 09
1
[PATCH] vhost: Remove the unused variable.
...it a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 79c6e7a60a5e..749fe13e061c 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -20,10 +20,6 @@ typedef void (*vhost_work_fn_t)(struct vhost_work *work); struct vhost_work { struct llist_node node; vhost_work_fn_t fn; - wait_queue_head_t done; - int flushing; - unsigned queue_seq; - unsigned done_seq; unsigned long flags; }; -- 2.13.6
2014 Nov 12
3
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
...ue.h> #include <linux/delay.h> #include <linux/slab.h> #include <linux/module.h> @@ -42,11 +41,9 @@ struct virtio_balloon struct virtio_device *vdev; struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; - /* Where the ballooning thread waits for config to change. */ - wait_queue_head_t config_change; - - /* The thread servicing the balloon. */ - struct task_struct *thread; + /* The workqueue servicing the balloon. */ + struct workqueue_struct *wq; + struct work_struct wq_work; /* Waiting for host to ack the pages we released. */ wait_queue_head_t acked; @@ -128,12 +125,13 @...
2014 Nov 12
3
[PATCH v2] virtio_balloon: Convert "vballon" kthread into a workqueue
...ue.h> #include <linux/delay.h> #include <linux/slab.h> #include <linux/module.h> @@ -42,11 +41,9 @@ struct virtio_balloon struct virtio_device *vdev; struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; - /* Where the ballooning thread waits for config to change. */ - wait_queue_head_t config_change; - - /* The thread servicing the balloon. */ - struct task_struct *thread; + /* The workqueue servicing the balloon. */ + struct workqueue_struct *wq; + struct work_struct wq_work; /* Waiting for host to ack the pages we released. */ wait_queue_head_t acked; @@ -128,12 +125,13 @...
2015 Dec 10
1
[PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko
..._virtio_vsock */ > +static void virtio_vsock_rx_fill(struct virtio_vsock *vsock); > + > +struct virtio_vsock { > + /* Virtio device */ > + struct virtio_device *vdev; > + /* Virtio virtqueue */ > + struct virtqueue *vqs[VSOCK_VQ_MAX]; > + /* Wait queue for send pkt */ > + wait_queue_head_t queue_wait; > + /* Work item to send pkt */ > + struct work_struct tx_work; > + /* Work item to recv pkt */ > + struct work_struct rx_work; > + /* Mutex to protect send pkt*/ > + struct mutex tx_lock; > + /* Mutex to protect recv pkt*/ > + struct mutex rx_lock; Further down...
2015 Dec 10
1
[PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko
..._virtio_vsock */ > +static void virtio_vsock_rx_fill(struct virtio_vsock *vsock); > + > +struct virtio_vsock { > + /* Virtio device */ > + struct virtio_device *vdev; > + /* Virtio virtqueue */ > + struct virtqueue *vqs[VSOCK_VQ_MAX]; > + /* Wait queue for send pkt */ > + wait_queue_head_t queue_wait; > + /* Work item to send pkt */ > + struct work_struct tx_work; > + /* Work item to recv pkt */ > + struct work_struct rx_work; > + /* Mutex to protect send pkt*/ > + struct mutex tx_lock; > + /* Mutex to protect recv pkt*/ > + struct mutex rx_lock; Further down...
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 Dec 04
0
[PATCH v4 2/2] virtio_balloon: Use a workqueue instead of "vballoon" kthread
....h> #include <linux/delay.h> #include <linux/slab.h> #include <linux/module.h> @@ -49,11 +48,8 @@ struct virtio_balloon { struct virtio_device *vdev; struct virtqueue *inflate_vq, *deflate_vq, *stats_vq; - /* Where the ballooning thread waits for config to change. */ - wait_queue_head_t config_change; - - /* The thread servicing the balloon. */ - struct task_struct *thread; + /* The balloon servicing is delegated to a freezable workqueue. */ + struct work_struct wq_work; /* Waiting for host to ack the pages we released. */ wait_queue_head_t acked; @@ -255,14 +251,15 @@ stati...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...truct vhost_work work; + struct completion wait_event; +}; + +static void vhost_flush_work(struct vhost_work *work) +{ + struct vhost_flush_struct *s; + + s = container_of(work, struct vhost_flush_struct, work); + complete(&s->wait_event); +} + static void vhost_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt) { @@ -158,8 +171,6 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) INIT_LIST_HEAD(&work->node); work->fn = fn; init_waitqueue_head(&work->done); - work->flushing = 0; - work->queue_seq = work->done_seq = 0; } EXPO...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...truct vhost_work work; + struct completion wait_event; +}; + +static void vhost_flush_work(struct vhost_work *work) +{ + struct vhost_flush_struct *s; + + s = container_of(work, struct vhost_flush_struct, work); + complete(&s->wait_event); +} + static void vhost_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt) { @@ -158,8 +171,6 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) INIT_LIST_HEAD(&work->node); work->fn = fn; init_waitqueue_head(&work->done); - work->flushing = 0; - work->queue_seq = work->done_seq = 0; } EXPO...
2015 Oct 30
5
[PATCH] vhost: move is_le setup to the backend
....c @@ -113,6 +113,12 @@ static void vhost_init_is_le(struct vhost_virtqueue *vq) } #endif /* CONFIG_VHOST_CROSS_ENDIAN_LEGACY */ +void vhost_set_is_le(struct vhost_virtqueue *vq) +{ + vhost_init_is_le(vq); +} +EXPORT_SYMBOL_GPL(vhost_set_is_le); + static void vhost_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt) { @@ -1156,12 +1162,8 @@ int vhost_init_used(struct vhost_virtqueue *vq) { __virtio16 last_used_idx; int r; - if (!vq->private_data) { - vq->is_le = virtio_legacy_is_little_endian(); + if (!vq->private_data) return 0; - } - - vhost_init_is_le(vq);...
2015 Oct 30
5
[PATCH] vhost: move is_le setup to the backend
....c @@ -113,6 +113,12 @@ static void vhost_init_is_le(struct vhost_virtqueue *vq) } #endif /* CONFIG_VHOST_CROSS_ENDIAN_LEGACY */ +void vhost_set_is_le(struct vhost_virtqueue *vq) +{ + vhost_init_is_le(vq); +} +EXPORT_SYMBOL_GPL(vhost_set_is_le); + static void vhost_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt) { @@ -1156,12 +1162,8 @@ int vhost_init_used(struct vhost_virtqueue *vq) { __virtio16 last_used_idx; int r; - if (!vq->private_data) { - vq->is_le = virtio_legacy_is_little_endian(); + if (!vq->private_data) return 0; - } - - vhost_init_is_le(vq);...