search for: done_seq

Displaying 20 results from an estimated 31 matches for "done_seq".

2010 Jul 29
1
[PATCH] vhost: locking/rcu cleanup
...ed mode, int sync, return 0; } +/* Must be called for each vq before vhost_dev_init. */ +void vhost_work_set_fn(struct vhost_work *work, vhost_work_fn_t fn) +{ + work->fn = fn; +} + +static void vhost_work_init(struct vhost_work *work) +{ + atomic_set(&work->queue_seq, 0); + work->done_seq = 0; +} + /* Init poll structure */ -void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, +void vhost_poll_init(struct vhost_poll *poll, struct vhost_work *work, unsigned long mask, struct vhost_dev *dev) { - struct vhost_work *work = &poll->work; - + poll->work = w...
2010 Jul 29
1
[PATCH] vhost: locking/rcu cleanup
...ed mode, int sync, return 0; } +/* Must be called for each vq before vhost_dev_init. */ +void vhost_work_set_fn(struct vhost_work *work, vhost_work_fn_t fn) +{ + work->fn = fn; +} + +static void vhost_work_init(struct vhost_work *work) +{ + atomic_set(&work->queue_seq, 0); + work->done_seq = 0; +} + /* Init poll structure */ -void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, +void vhost_poll_init(struct vhost_poll *poll, struct vhost_work *work, unsigned long mask, struct vhost_dev *dev) { - struct vhost_work *work = &poll->work; - + poll->work = w...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...ile, 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; } EXPORT_SYMBOL_GPL(vhost_work_init); @@ -211,31 +222,17 @@ void vhost_poll_stop(struct vhost_poll *poll) } EXPORT_SYMBOL_GPL(vhost_poll_stop); -static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, - unsigned seq) -{ - int left; - - spin_lock_irq(&dev-...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...ile, 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; } EXPORT_SYMBOL_GPL(vhost_work_init); @@ -211,31 +222,17 @@ void vhost_poll_stop(struct vhost_poll *poll) } EXPORT_SYMBOL_GPL(vhost_poll_stop); -static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, - unsigned seq) -{ - int left; - - spin_lock_irq(&dev-...
2010 Sep 05
0
[PATCH] vhost: fix attach to cgroups regression
...up(wait_queue_t *wait, unsigned mode, int sync, return 0; } +static 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; +} + /* Init poll structure */ void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, unsigned long mask, struct vhost_dev *dev) { - struct vhost_work *work = &poll->work; - init_waitqueue_func_entry(&poll->wait, vhost_poll_wakeup); init_poll_funcptr(&am...
2010 Sep 05
0
[PATCH] vhost: fix attach to cgroups regression
...up(wait_queue_t *wait, unsigned mode, int sync, return 0; } +static 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; +} + /* Init poll structure */ void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, unsigned long mask, struct vhost_dev *dev) { - struct vhost_work *work = &poll->work; - init_waitqueue_func_entry(&poll->wait, vhost_poll_wakeup); init_poll_funcptr(&am...
2018 Jan 09
1
[PATCH] vhost: Remove the unused variable.
...00644 --- 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
2011 Jan 10
0
[PATCH] vhost: fix signed/unsigned comparison
...,22 +98,26 @@ void vhost_poll_stop(struct vhost_poll *poll) remove_wait_queue(poll->wqh, &poll->wait); } +static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, + unsigned seq) +{ + int left; + spin_lock_irq(&dev->work_lock); + left = seq - work->done_seq; + spin_unlock_irq(&dev->work_lock); + return left <= 0; +} + static void vhost_work_flush(struct vhost_dev *dev, struct vhost_work *work) { unsigned seq; - int left; int flushing; spin_lock_irq(&dev->work_lock); seq = work->queue_seq; work->flushing++; spin_u...
2011 Jan 10
0
[PATCH] vhost: fix signed/unsigned comparison
...,22 +98,26 @@ void vhost_poll_stop(struct vhost_poll *poll) remove_wait_queue(poll->wqh, &poll->wait); } +static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, + unsigned seq) +{ + int left; + spin_lock_irq(&dev->work_lock); + left = seq - work->done_seq; + spin_unlock_irq(&dev->work_lock); + return left <= 0; +} + static void vhost_work_flush(struct vhost_dev *dev, struct vhost_work *work) { unsigned seq; - int left; int flushing; spin_lock_irq(&dev->work_lock); seq = work->queue_seq; work->flushing++; spin_u...
2018 Jan 09
0
[PATCH v2] vhost: Remove the unused variable.
...00644 --- 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
2016 Apr 26
0
[PATCH 2/2] vhost: lockless enqueuing
...@ struct vhost_work; typedef void (*vhost_work_fn_t)(struct vhost_work *work); +#define VHOST_WORK_QUEUED 1 struct vhost_work { - struct list_head node; + 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) */ @@ -126,8 +128,7 @@ struct vhost_dev { int nvqs; struct file *log_file; struct eventfd_ctx *log_ctx; - spinlock_t work_lock; - struct list_head work_list; + struct llist_head work_list; struct task_struct *worker; };...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...ude <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 *wqh; - wait_queue_t wait; - struct vhost_work work; - unsi...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...ude <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 *wqh; - wait_queue_t wait; - struct vhost_work work; - unsi...
2016 Apr 26
2
[PATCH 2/2] vhost: lockless enqueuing
...n_t)(struct vhost_work *work); > > +#define VHOST_WORK_QUEUED 1 > struct vhost_work { > - struct list_head node; > + 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) */ > @@ -126,8 +128,7 @@ struct vhost_dev { > int nvqs; > struct file *log_file; > struct eventfd_ctx *log_ctx; > - spinlock_t work_lock; > - struct list_head work_list; > + struct ll...
2016 Apr 26
2
[PATCH 2/2] vhost: lockless enqueuing
...n_t)(struct vhost_work *work); > > +#define VHOST_WORK_QUEUED 1 > struct vhost_work { > - struct list_head node; > + 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) */ > @@ -126,8 +128,7 @@ struct vhost_dev { > int nvqs; > struct file *log_file; > struct eventfd_ctx *log_ctx; > - spinlock_t work_lock; > - struct list_head work_list; > + struct ll...
2014 Aug 10
0
[PATCH] vhost: Add polling mode
...+void vhost_work_init(struct vhost_work *work, struct vhost_virtqueue *vq, > + 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; > + work->vq = vq; > } > EXPORT_SYMBOL_GPL(vhost_work_init); > > /* Init poll structure */ > void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, > - unsigned long mask, struct vhost_dev *dev) > + unsigned long mask, struct vhost_virtqu...
2017 Mar 10
0
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...gt; -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 *wqh; > - wait_queue_t...
2012 Dec 27
3
[PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()
Fix the leaking of oldubufs and fd refcnt when fail to initialized used ring. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/net.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index ebd08b2..629d6b5 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -834,8 +834,10 @@ static
2012 Dec 27
3
[PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()
Fix the leaking of oldubufs and fd refcnt when fail to initialized used ring. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/net.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index ebd08b2..629d6b5 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -834,8 +834,10 @@ static
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...; +#include <linux/module.h> > > > > > > #include "vhost.h" > > > > > > @@ -66,6 +67,7 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) > > > work->flushing = 0; > > > work->queue_seq = work->done_seq = 0; > > > } > > > +EXPORT_SYMBOL_GPL(vhost_work_init); > > > > > > /* Init poll structure */ > > > void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, > > > @@ -79,6 +81,7 @@ void vhost_poll_init(struct vhost_poll *poll, vhos...