lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHGf_=qcV=R_O5fpjpRQh5Tu9=nz1jVR9r=55fYODds8TQm7vw@mail.gmail.com>
Date:	Thu, 18 Apr 2013 09:32:58 -0700
From:	KOSAKI Motohiro <kosaki.motohiro@...il.com>
To:	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
Cc:	Ingo Molnar <mingo@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [Bug fix PATCH] numa, cpu hotplug: Change links of CPU and node
 when changing node number by onlining CPU

>  #ifdef CONFIG_HOTPLUG_CPU
> +static void change_cpu_under_node(struct cpu *cpu,
> +                       unsigned int from_nid, unsigned int to_nid)
> +{
> +       int cpuid = cpu->dev.id;
> +       unregister_cpu_under_node(cpuid, from_nid);
> +       register_cpu_under_node(cpuid, to_nid);
> +       cpu->node_id = to_nid;
> +}
> +

Where is stub for !CONFIG_HOTPLUG_CPU?


>  static ssize_t show_online(struct device *dev,
>                            struct device_attribute *attr,
>                            char *buf)
> @@ -39,17 +48,23 @@ static ssize_t __ref store_online(struct device *dev,
>                                   const char *buf, size_t count)
>  {
>         struct cpu *cpu = container_of(dev, struct cpu, dev);
> +       int num = cpu->dev.id;

"num" is wrong name. cpuid may be better.


> +       int from_nid, to_nid;
>         ssize_t ret;
>
>         cpu_hotplug_driver_lock();
>         switch (buf[0]) {
>         case '0':
> -               ret = cpu_down(cpu->dev.id);
> +               ret = cpu_down(num);
>                 if (!ret)
>                         kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
>                 break;
>         case '1':
> -               ret = cpu_up(cpu->dev.id);
> +               from_nid = cpu_to_node(num);
> +               ret = cpu_up(num);
> +               to_nid = cpu_to_node(num);
> +               if (from_nid != to_nid)
> +                       change_cpu_under_node(cpu, from_nid, to_nid);

You need to add several comments. this code is not straightforward.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ