mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Youquan Song <youquan.song@intel.com>
Cc: gregkh@linuxfoundation.org, torvalds@linux-foundation.org,
	linux-kernel@vger.kernel.org,
	Youquan Song <youquan.song@linux.intel.com>
Subject: Re: [PATCH] core: Fix maxcpus boot option broken
Date: Fri, 31 May 2013 14:52:14 -0700	[thread overview]
Message-ID: <20130531145214.27bb260219f55131b6e6e605@linux-foundation.org> (raw)
In-Reply-To: <1369886406-14079-1-git-send-email-youquan.song@intel.com>

On Thu, 30 May 2013 00:00:06 -0400 Youquan Song <youquan.song@intel.com> wrote:

> maxcpus boot option to limit maximum number of CPUs on system, but this option
> is broken at recent kernel.

Can you help us identify which kernel versions have this bug? 
Identifying the offending commit would be best.  Thanks.

> Though we use maxcpus to limit CPUs number, but
> current kernel will register all of present CPUs in sysfs.
> udev will enumerate all registered cpu at sysfs, and it will bring up the CPU
> if the CPU is offline. So the maxcpus option is broken.
> 
> This patch will only register the CPU which is not over limitation of maxcpus 
> option in sysfs. So it will keep the maxcpus limitation when udev enumeration
> or other intention of bring up CPUs over the limitation by method like  
> echo 1 > /sys/devices/system/cpu/online 
> 
> ...
>
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -272,6 +272,10 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
>  {
>  	int error;
>  
> +	/* return when cpu number greater than maximum number of CPUs */
> +	if (num >= setup_max_cpus)
> +		return 0;
> +
>  	cpu->node_id = cpu_to_node(num);
>  	memset(&cpu->dev, 0x00, sizeof(struct device));
>  	cpu->dev.id = num;
> -- 
> 1.7.7.4

      reply	other threads:[~2013-05-31 21:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30  4:00 Youquan Song
2013-05-31 21:52 ` Andrew Morton [this message]

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=20130531145214.27bb260219f55131b6e6e605@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=youquan.song@intel.com \
    --cc=youquan.song@linux.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

all inboxes | Powered by JetHome®