From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754688Ab2DUCZy (ORCPT ); Fri, 20 Apr 2012 22:25:54 -0400 Received: from am1ehsobe006.messaging.microsoft.com ([213.199.154.209]:24032 "EHLO am1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752590Ab2DUCZw (ORCPT ); Fri, 20 Apr 2012 22:25:52 -0400 X-SpamScore: -3 X-BigFish: VPS-3(z1039ozbb2dI1432N98dKzz1202hzz8275ch8275bh8275dhz2fh668h839hd25h) X-Forefront-Antispam-Report: CIP:160.33.98.74;KIP:(null);UIP:(null);IPV:NLI;H:mail7.fw-bc.sony.com;RD:mail7.fw-bc.sony.com;EFVD:NLI Message-ID: <4F921A95.3030805@am.sony.com> Date: Fri, 20 Apr 2012 19:25:25 -0700 From: Frank Rowand Reply-To: User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 MIME-Version: 1.0 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" Subject: Re: [patch 04/18] smp: Provide generic idle thread allocation References: <20120420122120.097464672@linutronix.de> <20120420124557.102478630@linutronix.de> In-Reply-To: <20120420124557.102478630@linutronix.de> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginatorOrg: am.sony.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/20/12 06:05, Thomas Gleixner wrote: > All SMP architectures have magic to fork the idle task and to store it > for reusage when cpu hotplug is enabled. Provide a generic > infrastructure for it. > > Create/reinit the idle thread for the cpu which is brought up in the > generic code and hand the thread pointer to the architecture code via > __cpu_up(). > > Note, that fork_idle() is called via a workqueue, because this > guarantees that the idle thread does not get a reference to a user > space VM. This can happen when the boot process did not bring up all > possible cpus and a later cpu_up() is initiated via the sysfs > interface. In that case fork_idle() would be called in the context of > the user space task and take a reference on the user space VM. > > Signed-off-by: Thomas Gleixner > Cc: Matt Turner > Cc: Russell King > Cc: Mike Frysinger > Cc: Jesper Nilsson > Cc: Richard Kuo > Cc: Tony Luck > Cc: Hirokazu Takata > Cc: Ralf Baechle > Cc: David Howells > Cc: "James E.J. Bottomley" > Cc: Benjamin Herrenschmidt > Cc: Martin Schwidefsky > Cc: Paul Mundt > Cc: "David S. Miller" > Cc: Chris Metcalf > Cc: Richard Weinberger > Cc: x86@kernel.org > --- > arch/Kconfig | 3 + > kernel/cpu.c | 2 - > kernel/sched/core.c | 2 + > kernel/smpboot.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > kernel/smpboot.h | 10 ++++++ > 5 files changed, 99 insertions(+), 1 deletion(-) > > Index: linux-2.6/arch/Kconfig > =================================================================== > --- linux-2.6.orig/arch/Kconfig > +++ linux-2.6/arch/Kconfig > @@ -145,6 +145,9 @@ config HAVE_DMA_ATTRS > config USE_GENERIC_SMP_HELPERS > bool > > +config GENERIC_SMP_IDLE_THREAD > + bool ^^^^^ This _appears_ to be spaces instead of a tab. Hopefully not a false alarm, I know my mail servers randomly change tabs to spaces, just to mess with me, but I double checked at the lkml archive. > + > config HAVE_REGS_AND_STACK_ACCESS_API > bool > help < snip > - Frank From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frank Rowand Subject: Re: [patch 04/18] smp: Provide generic idle thread allocation Date: Fri, 20 Apr 2012 19:25:25 -0700 Message-ID: <4F921A95.3030805@am.sony.com> References: <20120420122120.097464672@linutronix.de> <20120420124557.102478630@linutronix.de> Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from am1ehsobe006.messaging.microsoft.com ([213.199.154.209]:24032 "EHLO am1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752590Ab2DUCZw (ORCPT ); Fri, 20 Apr 2012 22:25:52 -0400 In-Reply-To: <20120420124557.102478630@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 On 04/20/12 06:05, Thomas Gleixner wrote: > All SMP architectures have magic to fork the idle task and to store it > for reusage when cpu hotplug is enabled. Provide a generic > infrastructure for it. > > Create/reinit the idle thread for the cpu which is brought up in the > generic code and hand the thread pointer to the architecture code via > __cpu_up(). > > Note, that fork_idle() is called via a workqueue, because this > guarantees that the idle thread does not get a reference to a user > space VM. This can happen when the boot process did not bring up all > possible cpus and a later cpu_up() is initiated via the sysfs > interface. In that case fork_idle() would be called in the context of > the user space task and take a reference on the user space VM. > > Signed-off-by: Thomas Gleixner > Cc: Matt Turner > Cc: Russell King > Cc: Mike Frysinger > Cc: Jesper Nilsson > Cc: Richard Kuo > Cc: Tony Luck > Cc: Hirokazu Takata > Cc: Ralf Baechle > Cc: David Howells > Cc: "James E.J. Bottomley" > Cc: Benjamin Herrenschmidt > Cc: Martin Schwidefsky > Cc: Paul Mundt > Cc: "David S. Miller" > Cc: Chris Metcalf > Cc: Richard Weinberger > Cc: x86@kernel.org > --- > arch/Kconfig | 3 + > kernel/cpu.c | 2 - > kernel/sched/core.c | 2 + > kernel/smpboot.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > kernel/smpboot.h | 10 ++++++ > 5 files changed, 99 insertions(+), 1 deletion(-) > > Index: linux-2.6/arch/Kconfig > =================================================================== > --- linux-2.6.orig/arch/Kconfig > +++ linux-2.6/arch/Kconfig > @@ -145,6 +145,9 @@ config HAVE_DMA_ATTRS > config USE_GENERIC_SMP_HELPERS > bool > > +config GENERIC_SMP_IDLE_THREAD > + bool ^^^^^ This _appears_ to be spaces instead of a tab. Hopefully not a false alarm, I know my mail servers randomly change tabs to spaces, just to mess with me, but I double checked at the lkml archive. > + > config HAVE_REGS_AND_STACK_ACCESS_API > bool > help < snip > - Frank