Re: [PATCH v5 2/3] x86/topology: Avoid wasting 128k for package id array

From: Andi Kleen
Date: Fri Nov 10 2017 - 10:01:18 EST


> > All of that works. There is no way to make sure that a lookup is fully
> > serialized against a concurrent update. Even if the lookup holds
> > cpu_read_lock() the new package might arrive right after the unlock.
> >
>
> Thanks Thomas.
>
> Andi, do you want to take a look at this?

I was originally worried about races, that is why i tried to put
everything into cpu_data. But that didn't work out because something
clears it. Perhaps the right solution would be some extra per_cpu
data variables, and search for the first match. I suspect that would
be simpler. But if that doesn't work I guess something like Thomas'
example will work.

I assume you will handle it, Prarit?

-Andi