[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8c87752e-bffe-4cc0-b838-cb6486b6261d@oracle.com>
Date: Mon, 7 Apr 2025 11:03:48 -0500
From: Mike Christie <michael.christie@...cle.com>
To: Cindy Lu <lulu@...hat.com>, jasowang@...hat.com, mst@...hat.com,
sgarzare@...hat.com, linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org
Subject: Re: [PATCH v8 5/8] vhost: Reintroduce kthread mode support in vhost
On 3/28/25 5:02 AM, Cindy Lu wrote:
> +static int vhost_kthread_worker_create(struct vhost_worker *worker,
> + struct vhost_dev *dev, const char *name)
> +{
> + struct task_struct *task;
> + u32 id;
> + int ret;
> +
> + task = kthread_create(vhost_run_work_kthread_list, worker, "%s", name);
> + if (IS_ERR(task))
> + return PTR_ERR(task);
> +
> + worker->kthread_task = task;
> + wake_up_process(task);
> + ret = xa_alloc(&dev->worker_xa, &id, worker, xa_limit_32b, GFP_KERNEL);
> + if (ret < 0)
> + goto stop_worker;
> +
> + ret = vhost_attach_task_to_cgroups(worker);
> + if (ret)
If you go to stop_worker here, it will leave the worker in the xa above. I
think you need another goto to unwind that.
> + goto stop_worker;
> +
> + worker->id = id;
> + return 0;
> +
> +stop_worker:
> + vhost_kthread_do_stop(worker);
> + return ret;
> +}
> +
Powered by blists - more mailing lists