Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416980

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

From Lianwei Wang <lianwei.wang@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] cpu/hotplug: handle unbalanced hotplug enable/disable
Date 2016-06-08 09:40 +0200
Message-ID <rHGfL-5Ap-3@gated-at.bofh.it> (permalink)
References <rHids-73B-9@gated-at.bofh.it> <rHiQ9-7y0-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jun 6, 2016 at 11:34 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Mon, 6 Jun 2016, 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.
>>
>> Do nothing if an unablanced hotplug enable detected.
>>
>> Signed-off-by: Lianwei Wang <lianwei.wang@gmail.com>
>> ---
>>  kernel/cpu.c | 21 +++++++++++++++++----
>>  1 file changed, 17 insertions(+), 4 deletions(-)
>>
>> diff --git a/kernel/cpu.c b/kernel/cpu.c
>> index 3e3f6e49eabb..8011b1e40523 100644
>> --- a/kernel/cpu.c
>> +++ b/kernel/cpu.c
>> @@ -245,6 +245,19 @@ void cpu_hotplug_done(void)
>>       cpuhp_lock_release();
>>  }
>>
>> +static void _cpu_hotplug_disable(void)
>
> What's the purpose of this function?
>
The only purpose is to make the cpu_hotplug_disable as one API and
always disable it from the same interface. It makes the code looks
more beautiful. But yes, we can remove it since it is not necessary
for this change.

>> +{
>> +     cpu_hotplug_disabled++;
>> +}
>> +
>> +static void _cpu_hotplug_enable(void)
>
> Double underscores please
>
Ok, I will update it.
>> +{
>> +     if (WARN(!cpu_hotplug_disabled, "Unbalanced cpu hotplug enable\n"))
>> +             return;
>
> And this want's to be a WARN_ONCE()
>
WARN is convenient for debugging because kernel buffer is limited and
we might lose the first warning message. But WARN_ONCE is good to me
too.

> Thanks,
>
>         tglx

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2] cpu/hotplug: handle unbalanced hotplug enable/disable Lianwei Wang <lianwei.wang@gmail.com> - 2016-06-07 08:00 +0200
  Re: [PATCH v2] cpu/hotplug: handle unbalanced hotplug  enable/disable Thomas Gleixner <tglx@linutronix.de> - 2016-06-07 08:40 +0200
    Re: [PATCH v2] cpu/hotplug: handle unbalanced hotplug enable/disable Lianwei Wang <lianwei.wang@gmail.com> - 2016-06-08 09:40 +0200

csiph-web