* possible_cpus broken in linux-next
@ 2013-05-29 17:10 Dave Hansen
2013-05-29 18:35 ` Toshi Kani
0 siblings, 1 reply; 6+ messages in thread
From: Dave Hansen @ 2013-05-29 17:10 UTC (permalink / raw)
To: Rafael J. Wysocki, Stephen Rothwell, Greg Kroah-Hartman,
Toshi Kani, LKML
If I boot with: maxcpus=2 possible_cpus=4, I get
# grep . /sys/devices/system/cpu/cpu[0-9]*/online'
/sys/devices/system/cpu/cpu1/online:1
/sys/devices/system/cpu/cpu2/online:1
/sys/devices/system/cpu/cpu3/online:1
on bad kernels, and this on working ones:
/sys/devices/system/cpu/cpu1/online:1
/sys/devices/system/cpu/cpu2/online:0
/sys/devices/system/cpu/cpu3/online:0
I also get -EINVAL if I try to re-offline them in this state. 2 and 3
don't show up in /proc/cpuinfo, so sysfs just looks broken here. This
happens in a KVM guest, so it should be dirt-simple for anyone to reproduce.
I bisected it down to:
> commit 0902a9044fa5b7a0456ea4daacec2c2b3189ba8c
> Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Date: Fri May 3 00:25:49 2013 +0200
>
> Driver core: Use generic offline/online for CPU offline/online
>
> Rework the CPU hotplug code in drivers/base/cpu.c to use the
> generic offline/online support introduced previously instead of
> its own CPU-specific code.
>
> For this purpose, modify cpu_subsys to provide offline and online
> callbacks for CONFIG_HOTPLUG_CPU set and remove the code handling
> the CPU-specific 'online' sysfs attribute.
>
> This modification is not supposed to change the user-observable
> behavior of the kernel (i.e. the 'online' attribute will be present
> in exactly the same place in sysfs and should trigger exactly the
> same actions as before).
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Reviewed-by: Toshi Kani <toshi.kani@hp.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: possible_cpus broken in linux-next
2013-05-29 17:10 possible_cpus broken in linux-next Dave Hansen
@ 2013-05-29 18:35 ` Toshi Kani
2013-05-29 18:50 ` Toshi Kani
0 siblings, 1 reply; 6+ messages in thread
From: Toshi Kani @ 2013-05-29 18:35 UTC (permalink / raw)
To: Dave Hansen
Cc: Rafael J. Wysocki, Stephen Rothwell, Greg Kroah-Hartman, LKML,
linux-acpi
On Wed, 2013-05-29 at 10:10 -0700, Dave Hansen wrote:
> If I boot with: maxcpus=2 possible_cpus=4, I get
>
> # grep . /sys/devices/system/cpu/cpu[0-9]*/online'
> /sys/devices/system/cpu/cpu1/online:1
> /sys/devices/system/cpu/cpu2/online:1
> /sys/devices/system/cpu/cpu3/online:1
>
> on bad kernels, and this on working ones:
>
> /sys/devices/system/cpu/cpu1/online:1
> /sys/devices/system/cpu/cpu2/online:0
> /sys/devices/system/cpu/cpu3/online:0
>
>
> I also get -EINVAL if I try to re-offline them in this state. 2 and 3
> don't show up in /proc/cpuinfo, so sysfs just looks broken here. This
> happens in a KVM guest, so it should be dirt-simple for anyone to reproduce.
>
> I bisected it down to:
>
> > commit 0902a9044fa5b7a0456ea4daacec2c2b3189ba8c
> > Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Date: Fri May 3 00:25:49 2013 +0200
> >
> > Driver core: Use generic offline/online for CPU offline/online
> >
> > Rework the CPU hotplug code in drivers/base/cpu.c to use the
> > generic offline/online support introduced previously instead of
> > its own CPU-specific code.
> >
> > For this purpose, modify cpu_subsys to provide offline and online
> > callbacks for CONFIG_HOTPLUG_CPU set and remove the code handling
> > the CPU-specific 'online' sysfs attribute.
> >
> > This modification is not supposed to change the user-observable
> > behavior of the kernel (i.e. the 'online' attribute will be present
> > in exactly the same place in sysfs and should trigger exactly the
> > same actions as before).
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Reviewed-by: Toshi Kani <toshi.kani@hp.com>
Thanks for the report. The following patch fixes the problem.
-Toshi
====
From: Toshi Kani <toshi.kani@hp.com>
Subject: [PATCH] ACPI: Fix sysfs cpu/online of offlined cpus
As reported by Dave Hansen, sysfs cpu/online shows 1 for
offlined cpus at boot.
https://lkml.org/lkml/2013/5/29/403
Fix this problem by initializing dev.offline with cpu_online()
when registering a cpu.
Reported-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
drivers/base/cpu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 130ba0b..b9f0eec 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -281,6 +281,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
cpu->dev.bus = &cpu_subsys;
cpu->dev.release = cpu_device_release;
cpu->dev.offline_disabled = !cpu->hotpluggable;
+ cpu->dev.offline = !cpu_online(num);
#ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
cpu->dev.bus->uevent = arch_cpu_uevent;
#endif
--
1.8.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: possible_cpus broken in linux-next
2013-05-29 18:35 ` Toshi Kani
@ 2013-05-29 18:50 ` Toshi Kani
2013-05-29 19:02 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Toshi Kani @ 2013-05-29 18:50 UTC (permalink / raw)
To: Dave Hansen
Cc: Rafael J. Wysocki, Stephen Rothwell, Greg Kroah-Hartman, LKML,
linux-acpi
On Wed, 2013-05-29 at 12:35 -0600, Toshi Kani wrote:
> On Wed, 2013-05-29 at 10:10 -0700, Dave Hansen wrote:
:
> Thanks for the report. The following patch fixes the problem.
> -Toshi
>
> ====
> From: Toshi Kani <toshi.kani@hp.com>
> Subject: [PATCH] ACPI: Fix sysfs cpu/online of offlined cpus
Typo. The subject needs to be:
Subject: [PATCH] cpu: Fix sysfs cpu/online of offlined cpus
-Toshi
> As reported by Dave Hansen, sysfs cpu/online shows 1 for
> offlined cpus at boot.
> https://lkml.org/lkml/2013/5/29/403
>
> Fix this problem by initializing dev.offline with cpu_online()
> when registering a cpu.
>
> Reported-by: Dave Hansen <dave.hansen@intel.com>
> Signed-off-by: Toshi Kani <toshi.kani@hp.com>
> ---
> drivers/base/cpu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> index 130ba0b..b9f0eec 100644
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -281,6 +281,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
> cpu->dev.bus = &cpu_subsys;
> cpu->dev.release = cpu_device_release;
> cpu->dev.offline_disabled = !cpu->hotpluggable;
> + cpu->dev.offline = !cpu_online(num);
> #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
> cpu->dev.bus->uevent = arch_cpu_uevent;
> #endif
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: possible_cpus broken in linux-next
2013-05-29 18:50 ` Toshi Kani
@ 2013-05-29 19:02 ` Rafael J. Wysocki
2013-05-29 22:14 ` Dave Hansen
0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2013-05-29 19:02 UTC (permalink / raw)
To: Toshi Kani, Dave Hansen
Cc: Stephen Rothwell, Greg Kroah-Hartman, LKML, linux-acpi
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8"; format="flowed", Size: 2199 bytes --]
On 5/29/2013 8:50 PM, Toshi Kani wrote:
> On Wed, 2013-05-29 at 12:35 -0600, Toshi Kani wrote:
>> On Wed, 2013-05-29 at 10:10 -0700, Dave Hansen wrote:
> :
>
>> Thanks for the report. The following patch fixes the problem.
>> -Toshi
>>
>> ====
>> From: Toshi Kani <toshi.kani@hp.com>
>> Subject: [PATCH] ACPI: Fix sysfs cpu/online of offlined cpus
> Typo. The subject needs to be:
>
> Subject: [PATCH] cpu: Fix sysfs cpu/online of offlined cpus
>
> -Toshi
>
>> As reported by Dave Hansen, sysfs cpu/online shows 1 for
>> offlined cpus at boot.
>> https://lkml.org/lkml/2013/5/29/403
>>
>> Fix this problem by initializing dev.offline with cpu_online()
>> when registering a cpu.
>>
>> Reported-by: Dave Hansen <dave.hansen@intel.com>
>> Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Thanks Toshi!
Dave, can you please confirm that the problem is fixed by this patch?
Rafael
>> ---
>> drivers/base/cpu.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
>> index 130ba0b..b9f0eec 100644
>> --- a/drivers/base/cpu.c
>> +++ b/drivers/base/cpu.c
>> @@ -281,6 +281,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
>> cpu->dev.bus = &cpu_subsys;
>> cpu->dev.release = cpu_device_release;
>> cpu->dev.offline_disabled = !cpu->hotpluggable;
>> + cpu->dev.offline = !cpu_online(num);
>> #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
>> cpu->dev.bus->uevent = arch_cpu_uevent;
>> #endif
>
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
z siedziba w Gdansku
ul. Slowackiego 173
80-298 Gdansk
Sad Rejonowy Gdansk Polnoc w Gdansku,
VII Wydzial Gospodarczy Krajowego Rejestru Sadowego,
numer KRS 101882
NIP 957-07-52-316
Kapital zakladowy 200.000 zl
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: possible_cpus broken in linux-next
2013-05-29 19:02 ` Rafael J. Wysocki
@ 2013-05-29 22:14 ` Dave Hansen
2013-05-29 22:46 ` Rafael J. Wysocki
0 siblings, 1 reply; 6+ messages in thread
From: Dave Hansen @ 2013-05-29 22:14 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Toshi Kani, Dave Hansen, Stephen Rothwell, Greg Kroah-Hartman,
LKML, linux-acpi
On 05/29/2013 12:02 PM, Rafael J. Wysocki wrote:
>>> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
>>> index 130ba0b..b9f0eec 100644
>>> --- a/drivers/base/cpu.c
>>> +++ b/drivers/base/cpu.c
>>> @@ -281,6 +281,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
>>> cpu->dev.bus = &cpu_subsys;
>>> cpu->dev.release = cpu_device_release;
>>> cpu->dev.offline_disabled = !cpu->hotpluggable;
>>> + cpu->dev.offline = !cpu_online(num);
>>> #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
>>> cpu->dev.bus->uevent = arch_cpu_uevent;
>>> #endif
This gets things working for me again. Thanks for the quick response!
Tested-by: Dave Hansen <dave.hansen@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: possible_cpus broken in linux-next
2013-05-29 22:14 ` Dave Hansen
@ 2013-05-29 22:46 ` Rafael J. Wysocki
0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2013-05-29 22:46 UTC (permalink / raw)
To: Dave Hansen
Cc: Rafael J. Wysocki, Toshi Kani, Dave Hansen, Stephen Rothwell,
Greg Kroah-Hartman, LKML, linux-acpi
On Wednesday, May 29, 2013 03:14:12 PM Dave Hansen wrote:
> On 05/29/2013 12:02 PM, Rafael J. Wysocki wrote:
> >>> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> >>> index 130ba0b..b9f0eec 100644
> >>> --- a/drivers/base/cpu.c
> >>> +++ b/drivers/base/cpu.c
> >>> @@ -281,6 +281,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
> >>> cpu->dev.bus = &cpu_subsys;
> >>> cpu->dev.release = cpu_device_release;
> >>> cpu->dev.offline_disabled = !cpu->hotpluggable;
> >>> + cpu->dev.offline = !cpu_online(num);
> >>> #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
> >>> cpu->dev.bus->uevent = arch_cpu_uevent;
> >>> #endif
>
> This gets things working for me again. Thanks for the quick response!
>
> Tested-by: Dave Hansen <dave.hansen@intel.com>
Applied.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-05-29 22:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-29 17:10 possible_cpus broken in linux-next Dave Hansen
2013-05-29 18:35 ` Toshi Kani
2013-05-29 18:50 ` Toshi Kani
2013-05-29 19:02 ` Rafael J. Wysocki
2013-05-29 22:14 ` Dave Hansen
2013-05-29 22:46 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox