lkml.org 
[lkml]   [2018]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] vhost: add per-vq worker thread
From
Date

On 2018/11/3 上午12:07, Vitaly Mayatskikh wrote:
> +
> +static int vhost_vq_poll_start(struct vhost_virtqueue *vq)
> +{
> + if (!vq->worker) {
> + vq->worker = kthread_create(vhost_vq_worker, vq, "vhost-%d/%i",
> + vq->dev->pid, vq->index);
> + if (IS_ERR(vq->worker)) {
> + int ret = PTR_ERR(vq->worker);
> +
> + pr_err("%s: can't create vq worker: %d\n", __func__,
> + ret);
> + vq->worker = NULL;
> + return ret;
> + }
> + }
> + vhost_work_init(&vq->work, vhost_vq_poll_start_work);
> + vhost_vq_work_queue(vq, &vq->work);
> + return 0;
> +}
> +


I wonder whether or not it's better to allow the device to specific the
worker here instead of forcing a per vq worker model. Then we can keep
the behavior of exist implementation and do optimization on top?

Thanks


\
 
 \ /
  Last update: 2018-11-05 03:54    [W:3.107 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site