search for: llist_del_all

Displaying 20 results from an estimated 54 matches for "llist_del_all".

2023 May 23
4
[PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression
...nt dead" should die, No, probably we shouldn't call get_signal() if we have already dequeued SIGKILL. > but let me think tomorrow. May be something like this... I don't like it but I can't suggest anything better right now. bool killed = false; for (;;) { ... node = llist_del_all(&worker->work_list); if (!node) { schedule(); /* * When we get a SIGKILL our release function will * be called. That will stop new IOs from being queued * and check for outstanding cmd responses. It will then * call vhost_task_stop to tell us to return and exit. *...
2017 Nov 09
2
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
..._resp v_rsp; - struct vhost_scsi_cmd *cmd; + struct vhost_scsi_cmd *cmd, *t; struct llist_node *llnode; struct se_cmd *se_cmd; struct iov_iter iov_iter; @@ -527,7 +527,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) bitmap_zero(signal, VHOST_SCSI_MAX_VQ); llnode = llist_del_all(&vs->vs_completion_list); - llist_for_each_entry(cmd, llnode, tvc_completion_list) { + llist_for_each_entry_safe(cmd, t, llnode, tvc_completion_list) { se_cmd = &cmd->tvc_se_cmd; pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__, -- 1.9.1
2017 Nov 09
2
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
..._resp v_rsp; - struct vhost_scsi_cmd *cmd; + struct vhost_scsi_cmd *cmd, *t; struct llist_node *llnode; struct se_cmd *se_cmd; struct iov_iter iov_iter; @@ -527,7 +527,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) bitmap_zero(signal, VHOST_SCSI_MAX_VQ); llnode = llist_del_all(&vs->vs_completion_list); - llist_for_each_entry(cmd, llnode, tvc_completion_list) { + llist_for_each_entry_safe(cmd, t, llnode, tvc_completion_list) { se_cmd = &cmd->tvc_se_cmd; pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__, -- 1.9.1
2016 Apr 26
2
[PATCH 2/2] vhost: lockless enqueuing
...empty(&dev->work_list)) { > - work = list_first_entry(&dev->work_list, > - struct vhost_work, node); > - list_del_init(&work->node); > - } else > - work = NULL; > - spin_unlock_irq(&dev->work_lock); > > - if (work) { > + node = llist_del_all(&dev->work_list); > + if (!node) > + schedule(); > + > + node = llist_reverse_order(node); Can we avoid llist reverse here? > + /* make sure flag is seen after deletion */ > + smp_wmb(); > + llist_for_each_entry_safe(work, work_next, node, node) { > + clear...
2016 Apr 26
2
[PATCH 2/2] vhost: lockless enqueuing
...empty(&dev->work_list)) { > - work = list_first_entry(&dev->work_list, > - struct vhost_work, node); > - list_del_init(&work->node); > - } else > - work = NULL; > - spin_unlock_irq(&dev->work_lock); > > - if (work) { > + node = llist_del_all(&dev->work_list); > + if (!node) > + schedule(); > + > + node = llist_reverse_order(node); Can we avoid llist reverse here? > + /* make sure flag is seen after deletion */ > + smp_wmb(); > + llist_for_each_entry_safe(work, work_next, node, node) { > + clear...
2013 Mar 11
1
[PATCH -next] vhost-blk: remove unused variable
...- struct vhost_virtqueue *vq; struct vhost_blk_req *req; struct llist_node *llnode; struct vhost_blk *blk; @@ -429,7 +427,6 @@ static void vhost_blk_handle_host_kick(struct vhost_work *work) int ret; blk = container_of(work, struct vhost_blk, work); - vq = &blk->vq; llnode = llist_del_all(&blk->llhead); added = false;
2013 Mar 11
1
[PATCH -next] vhost-blk: remove unused variable
...- struct vhost_virtqueue *vq; struct vhost_blk_req *req; struct llist_node *llnode; struct vhost_blk *blk; @@ -429,7 +427,6 @@ static void vhost_blk_handle_host_kick(struct vhost_work *work) int ret; blk = container_of(work, struct vhost_blk, work); - vq = &blk->vq; llnode = llist_del_all(&blk->llhead); added = false;
2023 May 22
1
[PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression
On 05/22, Mike Christie wrote: > > On 5/22/23 7:30 AM, Oleg Nesterov wrote: > >> + /* > >> + * When we get a SIGKILL our release function will > >> + * be called. That will stop new IOs from being queued > >> + * and check for outstanding cmd responses. It will then > >> + * call vhost_task_stop to tell us to return and exit. >
2013 Jan 06
3
[PATCH] tcm_vhost: Use llist for cmd completion list
...o_scsi_cmd_resp v_rsp; struct tcm_vhost_cmd *tv_cmd; + struct llist_node *llnode; + struct se_cmd *se_cmd; + int ret; - while ((tv_cmd = vhost_scsi_get_cmd_from_completion(vs))) { - struct virtio_scsi_cmd_resp v_rsp; - struct se_cmd *se_cmd = &tv_cmd->tvc_se_cmd; - int ret; + llnode = llist_del_all(&vs->vs_completion_list); + while (llnode) { + tv_cmd = llist_entry(llnode, struct tcm_vhost_cmd, + tvc_completion_list); + llnode = llist_next(llnode); + se_cmd = &tv_cmd->tvc_se_cmd; pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__, tv_cmd, se_...
2013 Jan 06
3
[PATCH] tcm_vhost: Use llist for cmd completion list
...o_scsi_cmd_resp v_rsp; struct tcm_vhost_cmd *tv_cmd; + struct llist_node *llnode; + struct se_cmd *se_cmd; + int ret; - while ((tv_cmd = vhost_scsi_get_cmd_from_completion(vs))) { - struct virtio_scsi_cmd_resp v_rsp; - struct se_cmd *se_cmd = &tv_cmd->tvc_se_cmd; - int ret; + llnode = llist_del_all(&vs->vs_completion_list); + while (llnode) { + tv_cmd = llist_entry(llnode, struct tcm_vhost_cmd, + tvc_completion_list); + llnode = llist_next(llnode); + se_cmd = &tv_cmd->tvc_se_cmd; pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__, tv_cmd, se_...
2023 May 23
2
[PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression
...othing tests that case, and so we get some weird behaviors. >> but let me think tomorrow. > > May be something like this... I don't like it but I can't suggest anything better > right now. > > bool killed = false; > > for (;;) { > ... > > node = llist_del_all(&worker->work_list); > if (!node) { > schedule(); > /* > * When we get a SIGKILL our release function will > * be called. That will stop new IOs from being queued > * and check for outstanding cmd responses. It will then > * call vhost_task_stop t...
2023 Jun 01
4
[PATCH 1/1] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression
...worker *worker = data; struct vhost_work *work, *work_next; struct llist_node *node; - for (;;) { - /* mb paired w/ kthread_stop */ - set_current_state(TASK_INTERRUPTIBLE); - - if (vhost_task_should_stop(worker->vtsk)) { - __set_current_state(TASK_RUNNING); - break; - } - - node = llist_del_all(&worker->work_list); - if (!node) - schedule(); - + node = llist_del_all(&worker->work_list); + if (node) { node = llist_reverse_order(node); /* make sure flag is seen after deletion */ smp_wmb(); llist_for_each_entry_safe(work, work_next, node, node) { clear_bit(VH...
2023 May 22
2
[PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression
...struct vhost_worker *worker = data; > struct vhost_work *work, *work_next; > struct llist_node *node; > + bool dead = false; > > for (;;) { > /* mb paired w/ kthread_stop */ > @@ -349,8 +350,22 @@ static int vhost_worker(void *data) > } > > node = llist_del_all(&worker->work_list); > - if (!node) > + if (!node) { > schedule(); > + /* > + * When we get a SIGKILL our release function will > + * be called. That will stop new IOs from being queued > + * and check for outstanding cmd responses. It will then > +...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
We used to implement the work flushing through tracking queued seq, done seq, and the number of flushing. This patch simplify this by just implement work flushing through another kind of vhost work with completion. This will be used by lockless enqueuing patch. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/vhost.c | 53
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
We used to implement the work flushing through tracking queued seq, done seq, and the number of flushing. This patch simplify this by just implement work flushing through another kind of vhost work with completion. This will be used by lockless enqueuing patch. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/vhost.c | 53
2016 Apr 26
0
[PATCH 2/2] vhost: lockless enqueuing
...<jasowang at redhat.com> >> --- >> drivers/vhost/vhost.c | 52 >> +++++++++++++++++++++++++-------------------------- >> drivers/vhost/vhost.h | 7 ++++--- >> 2 files changed, 29 insertions(+), 30 deletions(-) [...] >> - if (work) { >> + node = llist_del_all(&dev->work_list); >> + if (!node) >> + schedule(); >> + >> + node = llist_reverse_order(node); > Can we avoid llist reverse here? > Probably not, this is because: - we should process the work exactly the same order as they were queued, otherwise flush won&...
2017 Nov 16
0
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
...d, *t; > > struct llist_node *llnode; > > struct se_cmd *se_cmd; > > struct iov_iter iov_iter; > > @@ -527,7 +527,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) > > > > bitmap_zero(signal, VHOST_SCSI_MAX_VQ); > > llnode = llist_del_all(&vs->vs_completion_list); > > - llist_for_each_entry(cmd, llnode, tvc_completion_list) { > > + llist_for_each_entry_safe(cmd, t, llnode, tvc_completion_list) { > > se_cmd = &cmd->tvc_se_cmd; > > > > pr_debug("%s tv_cmd %p resid %u status %#02...
2017 Nov 15
1
[PATCH] vhost/scsi: Use safe iteration in vhost_scsi_complete_cmd_work()
...d; > + struct vhost_scsi_cmd *cmd, *t; > struct llist_node *llnode; > struct se_cmd *se_cmd; > struct iov_iter iov_iter; > @@ -527,7 +527,7 @@ static void vhost_scsi_complete_cmd_work(struct vhost_work *work) > > bitmap_zero(signal, VHOST_SCSI_MAX_VQ); > llnode = llist_del_all(&vs->vs_completion_list); > - llist_for_each_entry(cmd, llnode, tvc_completion_list) { > + llist_for_each_entry_safe(cmd, t, llnode, tvc_completion_list) { > se_cmd = &cmd->tvc_se_cmd; > > pr_debug("%s tv_cmd %p resid %u status %#02x\n", __func__, >...
2016 Apr 26
0
[PATCH 2/2] vhost: lockless enqueuing
...(TASK_RUNNING); break; } - if (!list_empty(&dev->work_list)) { - work = list_first_entry(&dev->work_list, - struct vhost_work, node); - list_del_init(&work->node); - } else - work = NULL; - spin_unlock_irq(&dev->work_lock); - if (work) { + node = llist_del_all(&dev->work_list); + if (!node) + schedule(); + + node = llist_reverse_order(node); + /* make sure flag is seen after deletion */ + smp_wmb(); + llist_for_each_entry_safe(work, work_next, node, node) { + clear_bit(VHOST_WORK_QUEUED, &work->flags); __set_current_state(TASK_...
2018 Dec 10
1
[PATCH net 4/4] vhost: log dirty page correctly
...Complexity 1 include/linux/spinlock.h:spin_unlock Cyclomatic Complexity 1 include/linux/wait.h:init_waitqueue_func_entry Cyclomatic Complexity 1 include/linux/llist.h:init_llist_head Cyclomatic Complexity 1 include/linux/llist.h:llist_empty Cyclomatic Complexity 1 include/linux/llist.h:llist_del_all Cyclomatic Complexity 1 include/linux/rbtree.h:rb_link_node Cyclomatic Complexity 3 include/linux/overflow.h:__ab_c_size Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_dec_and_test Cyclomatic Complexity 1 include/linux/sched.h:task_thread_info Cyclomatic Complexity 1 inclu...