Re: [PATCH] cpu/hotplug: handle unbalanced hotplug enable/disable

From: Lianwei Wang
Date: Fri Apr 22 2016 - 12:33:23 EST


On Thu, Apr 21, 2016 at 3:50 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Wed, Apr 20, 2016 at 09:56:07PM -0700, Lianwei Wang wrote:
>> Currently it just print a warning message but did not
>> reset cpu_hotplug_disabled when the enable/disable is
>> unbalanced. The unbalanced enable/disable will lead
>> the cpu hotplug work abnormally.
>>
>> Reset it to 0 when an unablanced enable detected.
>
> How can this happen in the first place?

That's is my question too, and why we check it with WARN_ON here?
Obviously it is possible to happened because the
cpu_hotplug_disable/enable are both kernel API and any driver can call
it. A unbalanced check is a good way to handle it.

The actually problem here is that what we do in case it happened? Just
give a warning or do some error handling and recover it back? This's
my focus..