On 30/10/2018 09:33, Viresh Kumar wrote:
> On 30-10-18, 08:55, Daniel Lezcano wrote:
>> The workqueue is called from init_cpu_capacity_callback(). This one is
>> called in the notifier callback. IOW the notification callback
>> unregisters itself. But if it is not registered, it won't unregister,
>> hence it won't call the workqueue and init_cpu_capacity_notifier() is
>> not called.
> 
> Sorry, couldn't understand most of your reply :)

Logical, I didn't understand your initial comment :)

> Though let me try to explain the problem I was trying to show you..
> 
> cpufreq-notifier-callback
>         -> init_cpu_capacity_callback()
>                 -> free raw capacity
>                 -> queue_work() to unregister the notifier
>                 -> return
> 
>         ->init_cpu_capacity_callback() called again before work was processed.
>                 -> If we don't check raw_capacity, we may end up using
>                 NULL pointer, as the notifier isn't unregistered yet.

Oh, nice catch.

I'm wondering if having a statically per_cpu variable, even if it is not
free at the end, isn't worth regarding the twisted code we end up with
an allocation.




-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Reply via email to