From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752073Ab2DTUHU (ORCPT ); Fri, 20 Apr 2012 16:07:20 -0400 Received: from mail-pz0-f52.google.com ([209.85.210.52]:56396 "EHLO mail-pz0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751349Ab2DTUHR convert rfc822-to-8bit (ORCPT ); Fri, 20 Apr 2012 16:07:17 -0400 MIME-Version: 1.0 In-Reply-To: <20120420124557.035417523@linutronix.de> References: <20120420122120.097464672@linutronix.de> <20120420124557.035417523@linutronix.de> Date: Fri, 20 Apr 2012 13:07:16 -0700 X-Google-Sender-Auth: JuJohKRaBvEZs8fnaTpkbPpKl20 Message-ID: Subject: Re: [patch 03/18] smp: Add generic smpboot facility From: Yinghai Lu To: Thomas Gleixner Cc: LKML , linux-arch@vger.kernel.org, Peter Zijlstra , Rusty Russell , "Paul E. McKenney" , Ingo Molnar , "Srivatsa S. Bhat" , Matt Turner , Russell King , Mike Frysinger , Jesper Nilsson , Richard Kuo , Tony Luck , Hirokazu Takata , Ralf Baechle , David Howells , "James E.J. Bottomley" , Benjamin Herrenschmidt , Martin Schwidefsky , Paul Mundt , "David S. Miller" , Chris Metcalf , Richard Weinberger , x86@kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2012 at 6:05 AM, Thomas Gleixner wrote: > Start a new file, which will hold SMP and CPU hotplug related generic > infrastructure. > =================================================================== > --- linux-2.6.orig/kernel/cpu.c > +++ linux-2.6/kernel/cpu.c > @@ -17,6 +17,8 @@ >  #include >  #include > > +#include "smpboot.h" > + >  #ifdef CONFIG_SMP >  /* Serializes the updates to cpu_online_mask, cpu_present_mask */ >  static DEFINE_MUTEX(cpu_add_remove_lock); > @@ -300,6 +302,11 @@ static int __cpuinit _cpu_up(unsigned in >                return -EINVAL; > >        cpu_hotplug_begin(); > + > +       ret = smpboot_prepare(cpu); > +       if (ret) > +               goto out; > + >        ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls); >        if (ret) { >                nr_calls--; > @@ -320,6 +327,7 @@ static int __cpuinit _cpu_up(unsigned in >  out_notify: >        if (ret != 0) >                __cpu_notify(CPU_UP_CANCELED | mod, hcpu, nr_calls, NULL); > +out: >        cpu_hotplug_done(); > >        return ret; > Index: linux-2.6/kernel/smpboot.c > =================================================================== > --- /dev/null > +++ linux-2.6/kernel/smpboot.c > @@ -0,0 +1,12 @@ > +/* > + * Common SMP CPU bringup/teardown functions > + */ > + > +#include "smpboot.h" > + > +/** > + * smpboot_prepare - generic smpboot preparation > + */ > +int __cpuinit smpboot_prepare(unsigned int cpu) > +{ return 0; > +} From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yinghai Lu Subject: Re: [patch 03/18] smp: Add generic smpboot facility Date: Fri, 20 Apr 2012 13:07:16 -0700 Message-ID: References: <20120420122120.097464672@linutronix.de> <20120420124557.035417523@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-pz0-f52.google.com ([209.85.210.52]:56396 "EHLO mail-pz0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751349Ab2DTUHR convert rfc822-to-8bit (ORCPT ); Fri, 20 Apr 2012 16:07:17 -0400 In-Reply-To: <20120420124557.035417523@linutronix.de> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Thomas Gleixner Cc: LKML , linux-arch@vger.kernel.org, Peter Zijlstra , Rusty Russell , "Paul E. McKenney" , Ingo Molnar , "Srivatsa S. Bhat" , Matt Turner , Russell King , Mike Frysinger , Jesper Nilsson , Richard Kuo , Tony Luck , Hirokazu Takata , Ralf Baechle , David Howells , "James E.J. Bottomley" , Benjamin Herrenschmidt , Martin Schwidefsky , Paul Mundt , "David S. Miller" , Chris Metcalf Richard On Fri, Apr 20, 2012 at 6:05 AM, Thomas Gleixner w= rote: > Start a new file, which will hold SMP and CPU hotplug related generic > infrastructure. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- linux-2.6.orig/kernel/cpu.c > +++ linux-2.6/kernel/cpu.c > @@ -17,6 +17,8 @@ > =A0#include > =A0#include > > +#include "smpboot.h" > + > =A0#ifdef CONFIG_SMP > =A0/* Serializes the updates to cpu_online_mask, cpu_present_mask */ > =A0static DEFINE_MUTEX(cpu_add_remove_lock); > @@ -300,6 +302,11 @@ static int __cpuinit _cpu_up(unsigned in > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EINVAL; > > =A0 =A0 =A0 =A0cpu_hotplug_begin(); > + > + =A0 =A0 =A0 ret =3D smpboot_prepare(cpu); > + =A0 =A0 =A0 if (ret) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out; > + > =A0 =A0 =A0 =A0ret =3D __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &= nr_calls); > =A0 =A0 =A0 =A0if (ret) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0nr_calls--; > @@ -320,6 +327,7 @@ static int __cpuinit _cpu_up(unsigned in > =A0out_notify: > =A0 =A0 =A0 =A0if (ret !=3D 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__cpu_notify(CPU_UP_CANCELED | mod, hc= pu, nr_calls, NULL); > +out: > =A0 =A0 =A0 =A0cpu_hotplug_done(); > > =A0 =A0 =A0 =A0return ret; > Index: linux-2.6/kernel/smpboot.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /dev/null > +++ linux-2.6/kernel/smpboot.c > @@ -0,0 +1,12 @@ > +/* > + * Common SMP CPU bringup/teardown functions > + */ > + > +#include "smpboot.h" > + > +/** > + * smpboot_prepare - generic smpboot preparation > + */ > +int __cpuinit smpboot_prepare(unsigned int cpu) > +{ return 0; > +}