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

2017-11-12 Thread Prarit Bhargava
On 11/12/2017 08:36 AM, Thomas Gleixner wrote: > On Fri, 10 Nov 2017, Andi Kleen wrote: 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

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

2017-11-12 Thread Prarit Bhargava
On 11/12/2017 08:36 AM, Thomas Gleixner wrote: > On Fri, 10 Nov 2017, Andi Kleen wrote: 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

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

2017-11-12 Thread Thomas Gleixner
On Fri, 10 Nov 2017, Andi Kleen wrote: > > > 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. > >

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

2017-11-12 Thread Thomas Gleixner
On Fri, 10 Nov 2017, Andi Kleen wrote: > > > 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. > >

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

2017-11-10 Thread Andi Kleen
> Andi's idea would work and the code would become much cleaner, if > smp_store_cpu_info() only overwrote cpu_data for new physically hotplugged > cpus. Can always just use a separate per_cpu variable for this that is not cleared. -Andi

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

2017-11-10 Thread Andi Kleen
> Andi's idea would work and the code would become much cleaner, if > smp_store_cpu_info() only overwrote cpu_data for new physically hotplugged > cpus. Can always just use a separate per_cpu variable for this that is not cleared. -Andi

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

2017-11-10 Thread Prarit Bhargava
On 11/10/2017 10:01 AM, Andi Kleen wrote: >>> 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,

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

2017-11-10 Thread Prarit Bhargava
On 11/10/2017 10:01 AM, Andi Kleen wrote: >>> 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,

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

2017-11-10 Thread Andi Kleen
> > 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

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

2017-11-10 Thread Andi Kleen
> > 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

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

2017-11-10 Thread Thomas Gleixner
On Fri, 10 Nov 2017, Thomas Gleixner wrote: > On Fri, 10 Nov 2017, Prarit Bhargava wrote: > > On 11/09/2017 07:43 PM, Thomas Gleixner wrote: > > > On Sun, 5 Nov 2017, Prarit Bhargava wrote: > > >> [v5]: Change kmalloc to GFP_ATOMIC to fix "sleeping function" warning on > > >> virtual machines. >

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

2017-11-10 Thread Thomas Gleixner
On Fri, 10 Nov 2017, Thomas Gleixner wrote: > On Fri, 10 Nov 2017, Prarit Bhargava wrote: > > On 11/09/2017 07:43 PM, Thomas Gleixner wrote: > > > On Sun, 5 Nov 2017, Prarit Bhargava wrote: > > >> [v5]: Change kmalloc to GFP_ATOMIC to fix "sleeping function" warning on > > >> virtual machines. >

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

2017-11-10 Thread Thomas Gleixner
On Fri, 10 Nov 2017, Prarit Bhargava wrote: > On 11/09/2017 07:43 PM, Thomas Gleixner wrote: > > On Sun, 5 Nov 2017, Prarit Bhargava wrote: > >> [v5]: Change kmalloc to GFP_ATOMIC to fix "sleeping function" warning on > >> virtual machines. > > > > What has this to do with virtual machines? The

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

2017-11-10 Thread Thomas Gleixner
On Fri, 10 Nov 2017, Prarit Bhargava wrote: > On 11/09/2017 07:43 PM, Thomas Gleixner wrote: > > On Sun, 5 Nov 2017, Prarit Bhargava wrote: > >> [v5]: Change kmalloc to GFP_ATOMIC to fix "sleeping function" warning on > >> virtual machines. > > > > What has this to do with virtual machines? The

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

2017-11-10 Thread Prarit Bhargava
On 11/09/2017 07:43 PM, Thomas Gleixner wrote: > On Sun, 5 Nov 2017, Prarit Bhargava wrote: >> [v5]: Change kmalloc to GFP_ATOMIC to fix "sleeping function" warning on >> virtual machines. > > What has this to do with virtual machines? The very same issue is on > physcial hardware because this

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

2017-11-10 Thread Prarit Bhargava
On 11/09/2017 07:43 PM, Thomas Gleixner wrote: > On Sun, 5 Nov 2017, Prarit Bhargava wrote: >> [v5]: Change kmalloc to GFP_ATOMIC to fix "sleeping function" warning on >> virtual machines. > > What has this to do with virtual machines? The very same issue is on > physcial hardware because this

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

2017-11-09 Thread Thomas Gleixner
On Sun, 5 Nov 2017, Prarit Bhargava wrote: > [v5]: Change kmalloc to GFP_ATOMIC to fix "sleeping function" warning on > virtual machines. What has this to do with virtual machines? The very same issue is on physcial hardware because this is called from the early CPU bringup code with interrupts

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

2017-11-09 Thread Thomas Gleixner
On Sun, 5 Nov 2017, Prarit Bhargava wrote: > [v5]: Change kmalloc to GFP_ATOMIC to fix "sleeping function" warning on > virtual machines. What has this to do with virtual machines? The very same issue is on physcial hardware because this is called from the early CPU bringup code with interrupts