search for: vhost_work_init

Displaying 20 results from an estimated 153 matches for "vhost_work_init".

2014 Aug 10
0
[PATCH] vhost: Add polling mode
...diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c > index 4f4ffa4..665eeeb 100644 > --- a/drivers/vhost/scsi.c > +++ b/drivers/vhost/scsi.c > @@ -1528,9 +1528,9 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) > if (!vqs) > goto err_vqs; > > - vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work); > - vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work); > - > + vhost_work_init(&vs->vs_completion_work, NULL, > + vhost_scsi_complete_cmd_work); > + vhost_work_init(&vs->vs_event_work, NULL...
2014 Aug 20
0
[PATCH] vhost: Add polling mode
...diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c > index 4f4ffa4..665eeeb 100644 > --- a/drivers/vhost/scsi.c > +++ b/drivers/vhost/scsi.c > @@ -1528,9 +1528,9 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) > if (!vqs) > goto err_vqs; > > - vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work); > - vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work); > - > + vhost_work_init(&vs->vs_completion_work, NULL, > + vhost_scsi_complete_cmd_work); > + vhost_work_init(&vs->vs_event_work, NULL...
2014 Aug 10
7
[PATCH] vhost: Add polling mode
..._VQ_RX]); f->private_data = n; diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 4f4ffa4..665eeeb 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1528,9 +1528,9 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) if (!vqs) goto err_vqs; - vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work); - vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work); - + vhost_work_init(&vs->vs_completion_work, NULL, + vhost_scsi_complete_cmd_work); + vhost_work_init(&vs->vs_event_work, NULL, tcm_vhost_evt_work);...
2014 Aug 10
7
[PATCH] vhost: Add polling mode
..._VQ_RX]); f->private_data = n; diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 4f4ffa4..665eeeb 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1528,9 +1528,9 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) if (!vqs) goto err_vqs; - vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work); - vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work); - + vhost_work_init(&vs->vs_completion_work, NULL, + vhost_scsi_complete_cmd_work); + vhost_work_init(&vs->vs_event_work, NULL, tcm_vhost_evt_work);...
2018 Jan 09
1
[PATCH] vhost: Remove the unused variable.
...yue at gmail.com> --- drivers/vhost/vhost.c | 1 - drivers/vhost/vhost.h | 4 ---- 2 files changed, 5 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 33ac2b186b85..9b04cad91d65 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -181,7 +181,6 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) { clear_bit(VHOST_WORK_QUEUED, &work->flags); work->fn = fn; - init_waitqueue_head(&work->done); } EXPORT_SYMBOL_GPL(vhost_work_init); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 79c6e7a60a5e..749fe13e061c 1...
2013 Mar 22
0
[PATCH] tcm_vhost: Use vs for struct vhost_scsi
...m_vhost.c @@ -1194,48 +1194,48 @@ err_dev: static int vhost_scsi_open(struct inode *inode, struct file *f) { - struct vhost_scsi *s; + struct vhost_scsi *vs; int r, i; - s = kzalloc(sizeof(*s), GFP_KERNEL); - if (!s) + vs = kzalloc(sizeof(*vs), GFP_KERNEL); + if (!vs) return -ENOMEM; - vhost_work_init(&s->vs_completion_work, vhost_scsi_complete_cmd_work); - vhost_work_init(&s->vs_event_work, tcm_vhost_evt_work); + vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work); + vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work); - s->vs_events_nr =...
2013 Mar 22
0
[PATCH] tcm_vhost: Use vs for struct vhost_scsi
...m_vhost.c @@ -1194,48 +1194,48 @@ err_dev: static int vhost_scsi_open(struct inode *inode, struct file *f) { - struct vhost_scsi *s; + struct vhost_scsi *vs; int r, i; - s = kzalloc(sizeof(*s), GFP_KERNEL); - if (!s) + vs = kzalloc(sizeof(*vs), GFP_KERNEL); + if (!vs) return -ENOMEM; - vhost_work_init(&s->vs_completion_work, vhost_scsi_complete_cmd_work); - vhost_work_init(&s->vs_event_work, tcm_vhost_evt_work); + vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work); + vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work); - s->vs_events_nr =...
2023 Mar 28
1
[PATCH v6 04/11] vhost: take worker or vq instead of dev for flushing
...host.c +++ b/drivers/vhost/vhost.c @@ -247,6 +247,20 @@ static void vhost_work_queue_on(struct vhost_worker *worker, } } +static void vhost_work_flush_on(struct vhost_worker *worker) +{ + struct vhost_flush_struct flush; + + if (!worker) + return; + + init_completion(&flush.wait_event); + vhost_work_init(&flush.work, vhost_flush_work); + + vhost_work_queue_on(worker, &flush.work); + wait_for_completion(&flush.wait_event); +} + void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) { vhost_work_queue_on(dev->worker, work); @@ -261,15 +275,7 @@ EXPORT_SYMBOL_GPL(vhos...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...ost_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; } EXPORT_SYMBOL_GPL(vhost_work_init); @@ -211,31 +222,17 @@ void vhost_poll_st...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...ost_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; } EXPORT_SYMBOL_GPL(vhost_work_init); @@ -211,31 +222,17 @@ void vhost_poll_st...
2013 Sep 17
3
[PATCH] vhost/scsi: use vmalloc for order-10 allocation
...vs = kzalloc(sizeof(*vs), GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); + if (!vs) { + vs = vzalloc(sizeof(*vs)); + if (!vs) + goto err_vs; + } vqs = kmalloc(VHOST_SCSI_MAX_VQ * sizeof(*vqs), GFP_KERNEL); - if (!vqs) { - kfree(vs); - return -ENOMEM; - } + if (!vqs) + goto err_vqs; vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work); vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work); @@ -1407,14 +1416,18 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) tcm_vhost_init_inflight(vs, NULL); - if (r < 0) { - kfree(vqs); - kfree...
2013 Sep 17
3
[PATCH] vhost/scsi: use vmalloc for order-10 allocation
...vs = kzalloc(sizeof(*vs), GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); + if (!vs) { + vs = vzalloc(sizeof(*vs)); + if (!vs) + goto err_vs; + } vqs = kmalloc(VHOST_SCSI_MAX_VQ * sizeof(*vqs), GFP_KERNEL); - if (!vqs) { - kfree(vs); - return -ENOMEM; - } + if (!vqs) + goto err_vqs; vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work); vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work); @@ -1407,14 +1416,18 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) tcm_vhost_init_inflight(vs, NULL); - if (r < 0) { - kfree(vqs); - kfree...
2010 Sep 05
0
[PATCH] vhost: fix attach to cgroups regression
...nsertions(+), 22 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 4b99117..7c75dce 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -60,22 +60,25 @@ static int vhost_poll_wakeup(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,...
2010 Sep 05
0
[PATCH] vhost: fix attach to cgroups regression
...nsertions(+), 22 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 4b99117..7c75dce 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -60,22 +60,25 @@ static int vhost_poll_wakeup(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,...
2018 Sep 09
0
[PATCH net-next v8 5/7] net: vhost: introduce bitmap for vhost_poll
...EPOLLIN, dev); > > > > f->private_data = n; > > > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > > index a1c06e7..dc88a60 100644 > > --- a/drivers/vhost/vhost.c > > +++ b/drivers/vhost/vhost.c > > @@ -186,7 +186,7 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) > > > > /* Init poll structure */ > > void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, > > - __poll_t mask, struct vhost_dev *dev) > > + __u8 poll_id, __poll_t mask, str...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...; > #include <linux/slab.h> > > > #include <linux/kthread.h> > > > #include <linux/cgroup.h> > > > +#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 vho...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...; > #include <linux/slab.h> > > > #include <linux/kthread.h> > > > #include <linux/cgroup.h> > > > +#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 vho...
2018 Jan 09
0
[PATCH v2] vhost: Remove the unused variable.
...ng at redhat.com> --- drivers/vhost/vhost.c | 1 - drivers/vhost/vhost.h | 4 ---- 2 files changed, 5 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 33ac2b186b85..9b04cad91d65 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -181,7 +181,6 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) { clear_bit(VHOST_WORK_QUEUED, &work->flags); work->fn = fn; - init_waitqueue_head(&work->done); } EXPORT_SYMBOL_GPL(vhost_work_init); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 79c6e7a60a5e..749fe13e061c 1...
2023 Mar 28
12
[PATCH v6 00/11] vhost: multiple worker support
The following patches were built over linux-next which contains various vhost patches in mst's tree and the vhost_task patchset in Christian Brauner's tree: git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git kernel.user_worker branch: https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git/log/?h=kernel.user_worker The latter patchset handles the review comment
2013 Jan 06
3
[PATCH] tcm_vhost: Use llist for cmd completion list
...} - INIT_LIST_HEAD(&tv_cmd->tvc_completion_list); tv_cmd->tvc_tag = v_req->tag; tv_cmd->tvc_task_attr = v_req->task_attr; tv_cmd->tvc_exp_data_len = exp_data_len; @@ -859,8 +841,6 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) return -ENOMEM; vhost_work_init(&s->vs_completion_work, vhost_scsi_complete_cmd_work); - INIT_LIST_HEAD(&s->vs_completion_list); - spin_lock_init(&s->vs_completion_lock); s->vqs[VHOST_SCSI_VQ_CTL].handle_kick = vhost_scsi_ctl_handle_kick; s->vqs[VHOST_SCSI_VQ_EVT].handle_kick = vhost_scsi_evt_hand...