public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Youquan Song <youquan.song@linux.intel.com>
To: Toshi Kani <toshi.kani@hp.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	youquan.song@intel.com, Dave Hansen <dave@sr71.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	akpm@linux-foundation.org, youquan.song@linux.intel.com
Subject: Re: cpu hotplug:  possible_cpus broken (again?) next-20130607
Date: Wed, 12 Jun 2013 08:03:43 -0400	[thread overview]
Message-ID: <20130612120343.GA22109@linux-youquan.bj.intel.com> (raw)
In-Reply-To: <1370989954.21540.4.camel@misato.fc.hp.com>

On Tue, Jun 11, 2013 at 04:32:34PM -0600, Toshi Kani wrote:
> On Wed, 2013-06-12 at 00:34 +0200, Rafael J. Wysocki wrote:
> > On Tuesday, June 11, 2013 03:17:28 PM Dave Hansen wrote:
> > > On 06/11/2013 03:05 PM, Rafael J. Wysocki wrote:
> > > > On Tuesday, June 11, 2013 02:51:33 PM Dave Hansen wrote:
> > > >> possible_cpus looks broken again.  I'm booting with:
> > > >>
> > > >>  maxcpus=10 possible_cpus=160
> > > >>
> > > >> But I only get 0-9 in sysfs:
> > > >>
> > > >>> # ls /sys/devices/system/cpu/
> > > >>> cpu0  cpu2  cpu4  cpu6  cpu8  cpufreq  kernel_max  offline  possible  probe    uevent
> > > >>> cpu1  cpu3  cpu5  cpu7  cpu9  cpuidle  modalias    online   present   release
> > > > 
> > > > Can you please test the acpi-hotplug branch of the linux-pm.git tree?
> > > 
> > > That branch seems to work happily.
> > 
> > In that case the problem may have been reintroduced by a merge conflict fix in
> > linux-next.
> 
> I believe the problem was introduced by the following change.  From the
> description, though, this is exactly what this patch was trying to
> change...  Adding Youguan to the list.
> 
> commit 3e275a5ba367ab74b3a4e49114307baed989fcac
> Author: Youquan Song <youquan.song@intel.com>
> Date:   Fri Jun 7 10:07:08 2013 +1000
> 
>     drivers/base/cpu.c: fix maxcpus boot option
> 
Hi Toshi,

Thanks Thoshi for the information.
please try the below patch to fix the issue by moving the code to
store_online.

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 3d48fc8..2378f42 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -60,6 +60,13 @@ static ssize_t __ref store_online(struct device *dev,
                        kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
                break;
        case '1':
+#ifdef CONFIG_SMP
+              /* return when cpu number greater than maximum number of
CPUs */
+               if (setup_max_cpus <= num_online_cpus() + 1) {
+                       cpu_hotplug_driver_unlock();
+                       return -EINVAL;
+               }
+#endif
                from_nid = cpu_to_node(cpuid);
                ret = cpu_up(cpuid);

Thanks
-Youquan


  reply	other threads:[~2013-06-12  0:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11 21:51 cpu hotplug: possible_cpus broken (again?) next-20130607 Dave Hansen
2013-06-11 22:05 ` Rafael J. Wysocki
2013-06-11 22:17   ` Dave Hansen
2013-06-11 22:34     ` Rafael J. Wysocki
2013-06-11 22:32       ` Toshi Kani
2013-06-12 12:03         ` Youquan Song [this message]
2013-06-12  0:24           ` Dave Hansen
2013-06-12 12:32             ` Youquan Song
2013-06-12  4:07               ` Yinghai Lu
2013-06-12 11:02                 ` Rafael J. Wysocki
2013-06-13  1:36                   ` Youquan Song
2013-06-13 15:36                     ` Toshi Kani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130612120343.GA22109@linux-youquan.bj.intel.com \
    --to=youquan.song@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@sr71.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=sfr@canb.auug.org.au \
    --cc=toshi.kani@hp.com \
    --cc=youquan.song@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox