On 08/14/13 13:46, Michael S. Tsirkin wrote:
I'm confused by this explanation. done_seq is set here: if (work) { work->done_seq = seq; if (work->flushing) wake_up_all(&work->done); } and work is set here: if (!list_empty(&dev->work_list)) { work = list_first_entry(&dev->work_list, struct vhost_work, node); list_del_init(&work->node); seq = work->queue_seq; } this work is processed on the next line: if (work) { __set_current_state(TASK_RUNNING); work->fn(work); if (need_resched()) schedule(); } so how do we end up with a sequence of a work item that isn't processed?
I was wondering what would happen if a work item got requeued before done_seq is set. I think you are right and this should work fine.
Bart. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html