On Tue, Apr 8, 2025 at 12:04 AM Mike Christie <michael.chris...@oracle.com> wrote: > > 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. > sure, will fix this Thanks Cindy > > + goto stop_worker; > > + > > + worker->id = id; > > + return 0; > > + > > +stop_worker: > > + vhost_kthread_do_stop(worker); > > + return ret; > > +} > > + >
- Re: [PATCH v8 3/8] vhost: Add the cgroup related f... Stefano Garzarella
- [PATCH v8 8/8] vhost: Add a KConfig knob to enable IOCT... Cindy Lu
- Re: [PATCH v8 8/8] vhost: Add a KConfig knob to en... Stefano Garzarella
- Re: [PATCH v8 8/8] vhost: Add a KConfig knob to en... Michael S. Tsirkin
- [PATCH v8 5/8] vhost: Reintroduce kthread mode support ... Cindy Lu
- Re: [PATCH v8 5/8] vhost: Reintroduce kthread mode... Stefano Garzarella
- Re: [PATCH v8 5/8] vhost: Reintroduce kthread mode... Mike Christie
- Re: [PATCH v8 5/8] vhost: Reintroduce kthread ... Cindy Lu
- [PATCH v8 7/8] vhost: Add check for inherit_owner statu... Cindy Lu
- Re: [PATCH v8 7/8] vhost: Add check for inherit_ow... Stefano Garzarella
- [PATCH v8 4/8] vhost: Introduce vhost_worker_ops in vho... Cindy Lu
- Re: [PATCH v8 4/8] vhost: Introduce vhost_worker_o... Stefano Garzarella
- Re: [PATCH v8 4/8] vhost: Introduce vhost_work... Cindy Lu
- Re: [PATCH v8 4/8] vhost: Introduce vhost_... Stefano Garzarella
- Re: [PATCH v8 4/8] vhost: Introduce vhost_worker_o... Michael S. Tsirkin
- Re: [PATCH v8 4/8] vhost: Introduce vhost_work... Mike Christie