Re: [PATCH v1] cpuidle-haltpoll: vcpu hotplug support

2019-08-29 Thread Marcelo Tosatti
On Thu, Aug 29, 2019 at 03:24:31PM +0100, Joao Martins wrote: > On 8/29/19 2:50 PM, Joao Martins wrote: > > On 8/29/19 12:56 PM, Marcelo Tosatti wrote: > >> Hi Joao, > >> > >> On Wed, Aug 28, 2019 at 07:56:50PM +0100, Joao Martins wrote: > >>> +static void haltpoll_uninit(void) > >>> +{ > >>> +

Re: [PATCH v1] cpuidle-haltpoll: vcpu hotplug support

2019-08-29 Thread Joao Martins
On 8/29/19 2:50 PM, Joao Martins wrote: > On 8/29/19 12:56 PM, Marcelo Tosatti wrote: >> Hi Joao, >> >> On Wed, Aug 28, 2019 at 07:56:50PM +0100, Joao Martins wrote: >>> +static void haltpoll_uninit(void) >>> +{ >>> + unsigned int cpu; >>> + >>> + cpus_read_lock(); >>> + >>> +

Re: [PATCH v1] cpuidle-haltpoll: vcpu hotplug support

2019-08-29 Thread Joao Martins
On 8/29/19 12:56 PM, Marcelo Tosatti wrote: > Hi Joao, > > On Wed, Aug 28, 2019 at 07:56:50PM +0100, Joao Martins wrote: >> +static void haltpoll_uninit(void) >> +{ >> +unsigned int cpu; >> + >> +cpus_read_lock(); >> + >> +for_each_online_cpu(cpu) { >> +struct

Re: [PATCH v1] cpuidle-haltpoll: vcpu hotplug support

2019-08-29 Thread Marcelo Tosatti
Hi Joao, On Wed, Aug 28, 2019 at 07:56:50PM +0100, Joao Martins wrote: > When cpus != maxcpus cpuidle-haltpoll will fail to register all vcpus > past the online ones and thus fail to register the idle driver. > This is because cpuidle_add_sysfs() will return with -ENODEV as a > consequence from

Re: [PATCH v1] cpuidle-haltpoll: vcpu hotplug support

2019-08-28 Thread Rafael J. Wysocki
On Wed, Aug 28, 2019 at 8:58 PM Joao Martins wrote: > > When cpus != maxcpus cpuidle-haltpoll will fail to register all vcpus > past the online ones and thus fail to register the idle driver. > This is because cpuidle_add_sysfs() will return with -ENODEV as a > consequence from get_cpu_device()

[PATCH v1] cpuidle-haltpoll: vcpu hotplug support

2019-08-28 Thread Joao Martins
When cpus != maxcpus cpuidle-haltpoll will fail to register all vcpus past the online ones and thus fail to register the idle driver. This is because cpuidle_add_sysfs() will return with -ENODEV as a consequence from get_cpu_device() return no device for a non-existing CPU. Instead switch to