[PATCH v2] eal: fix thread race in control thread creation
Tyler Retzlaff
roretzla at linux.microsoft.com
Tue Mar 7 18:54:00 CET 2023
On Tue, Mar 07, 2023 at 02:53:34PM +0100, David Marchand wrote:
> On Thu, Mar 2, 2023 at 5:18 AM Honnappa Nagarahalli
> <Honnappa.Nagarahalli at arm.com> wrote:
> > > > > if (ctrl_thread_init(arg) != 0)
> > > > > return NULL;
> > > > >
> > > > > - return start_routine(params->arg);
> > > > > + return start_routine(start_arg);
> > > > We can free 'params' here after 'start_routine' returns.
> > >
> > > I guess it doesn't matter if the allocation is retained for the duration of
> > > start_routine() which could be ~long.
> > Yes, that's what I thought, it is a small size.
> >
> > >
> > > David/Honnappah let me know what you decide. if you'd prefer to change to
> > > honnappah's suggestion i'll put a new version up.
>
> Hum, how would it look like?
> - the parent thread would free params if the child thread fails to set affinity,
> - the child thread would free params otherwise,
>
> Is this what you propose?
>
> This works, but we have to be extra careful if any change is done in
> this part later.
i think the fix i've already put up is kind of trivially verifiable as
correct, if we just need a fix then it works.
>
>
> --
> David Marchand
More information about the dev
mailing list