lkml.org 
[lkml]   [2012]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [patch 04/18] smp: Provide generic idle thread allocation
    On Fri, Apr 20, 2012 at 01:05:45PM -0000, 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 <tglx@linutronix.de>
    > Cc: Matt Turner <mattst88@gmail.com>
    > Cc: Russell King <linux@arm.linux.org.uk>
    > Cc: Mike Frysinger <vapier@gentoo.org>
    > Cc: Jesper Nilsson <jesper.nilsson@axis.com>
    > Cc: Richard Kuo <rkuo@codeaurora.org>
    > Cc: Tony Luck <tony.luck@intel.com>
    > Cc: Hirokazu Takata <takata@linux-m32r.org>
    > Cc: Ralf Baechle <ralf@linux-mips.org>
    > Cc: David Howells <dhowells@redhat.com>
    > Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
    > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    > Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    > Cc: Paul Mundt <lethal@linux-sh.org>
    > Cc: "David S. Miller" <davem@davemloft.net>
    > Cc: Chris Metcalf <cmetcalf@tilera.com>
    > Cc: Richard Weinberger <richard@nod.at>
    > 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
    > +

    Symbols we select in arch Kconfig files are often named HAVE_*
    And no matter the name - a comment preceeding the definition of the symbol
    would be nice so it is possible to deduct the use of the symbol
    in a few years time when this thread is long forgotten.

    Sam


    \
     
     \ /
      Last update: 2012-04-20 18:23    [W:0.026 / U:178.128 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site