[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACLfguWQD5yMBOQLhMh1rt5FoqdfJtmBiHaC3y9g7p1f5q9zRw@mail.gmail.com>
Date: Tue, 8 Apr 2025 15:54:39 +0800
From: Cindy Lu <lulu@...hat.com>
To: Mike Christie <michael.christie@...cle.com>
Cc: 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 Tue, Apr 8, 2025 at 12:04 AM Mike Christie
<michael.christie@...cle.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;
> > +}
> > +
>
Powered by blists - more mailing lists