All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Thomas Gleixner <tglx@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, jesper.nilsson@axis.com, rusty@rustcorp.com.au,
	schwidefsky@de.ibm.com, peterz@infradead.org,
	cmetcalf@tilera.com, tony.luck@intel.com, ralf@linux-mips.org,
	linux@arm.linux.org.uk, vapier@gentoo.org, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, hpa@zytor.com, richard@nod.at,
	lethal@linux-sh.org, srivatsa.bhat@linux.vnet.ibm.com,
	davem@davemloft.net, paulmck@linux.vnet.ibm.com,
	benh@kernel.crashing.org, dhowells@redhat.com,
	mattst88@gmail.com, jejb@parisc-linux.org, takata@linux-m32r.org,
	rkuo@codeaurora.org
Subject: [tip:smp/hotplug] smp: Add generic smpboot facility
Date: Sat, 28 Apr 2012 02:04:13 -0700	[thread overview]
Message-ID: <tip-38498a67aa2cf8c80754b8d304bfacc10bc582b5@git.kernel.org> (raw)
In-Reply-To: <20120420124557.035417523@linutronix.de>

Commit-ID:  38498a67aa2cf8c80754b8d304bfacc10bc582b5
Gitweb:     http://git.kernel.org/tip/38498a67aa2cf8c80754b8d304bfacc10bc582b5
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Fri, 20 Apr 2012 13:05:44 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 26 Apr 2012 12:06:09 +0200

smp: Add generic smpboot facility

Start a new file, which will hold SMP and CPU hotplug related generic
infrastructure.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
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
Link: http://lkml.kernel.org/r/20120420124557.035417523@linutronix.de

---
 kernel/Makefile  |    1 +
 kernel/cpu.c     |    8 ++++++++
 kernel/smpboot.c |   14 ++++++++++++++
 kernel/smpboot.h |    6 ++++++
 4 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/kernel/Makefile b/kernel/Makefile
index cb41b95..6c07f30 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
 obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
 obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
 obj-$(CONFIG_SMP) += smp.o
+obj-$(CONFIG_SMP) += smpboot.o
 ifneq ($(CONFIG_SMP),y)
 obj-y += up.o
 endif
diff --git a/kernel/cpu.c b/kernel/cpu.c
index e711aef..e58b99a 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -17,6 +17,8 @@
 #include <linux/gfp.h>
 #include <linux/suspend.h>
 
+#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 int cpu, int tasks_frozen)
 		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 int cpu, int tasks_frozen)
 out_notify:
 	if (ret != 0)
 		__cpu_notify(CPU_UP_CANCELED | mod, hcpu, nr_calls, NULL);
+out:
 	cpu_hotplug_done();
 
 	return ret;
diff --git a/kernel/smpboot.c b/kernel/smpboot.c
new file mode 100644
index 0000000..6dae6a3
--- /dev/null
+++ b/kernel/smpboot.c
@@ -0,0 +1,14 @@
+/*
+ * Common SMP CPU bringup/teardown functions
+ */
+#include <linux/init.h>
+
+#include "smpboot.h"
+
+/**
+ * smpboot_prepare - generic smpboot preparation
+ */
+int __cpuinit smpboot_prepare(unsigned int cpu)
+{
+	return 0;
+}
diff --git a/kernel/smpboot.h b/kernel/smpboot.h
new file mode 100644
index 0000000..d88e771
--- /dev/null
+++ b/kernel/smpboot.h
@@ -0,0 +1,6 @@
+#ifndef SMPBOOT_H
+#define SMPBOOT_H
+
+int smpboot_prepare(unsigned int cpu);
+
+#endif

  parent reply	other threads:[~2012-04-28  9:05 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 13:05 [patch 00/18] SMP: Boot and CPU hotplug refactoring - Part 1 Thomas Gleixner
2012-04-20 13:05 ` [patch 01/18] m32r: Remove pointless function prototypes Thomas Gleixner
2012-04-28  9:01   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 02/18] smp: Add task_struct argument to __cpu_up() Thomas Gleixner
2012-04-20 13:05   ` Thomas Gleixner
2012-04-23  7:58   ` Jesper Nilsson
2012-04-23  7:58     ` Jesper Nilsson
2012-04-28  9:02   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 03/18] smp: Add generic smpboot facility Thomas Gleixner
2012-04-20 13:05   ` Thomas Gleixner
2012-04-20 20:07   ` Yinghai Lu
2012-04-20 20:07     ` Yinghai Lu
2012-04-21  2:07   ` Stephen Rothwell
2012-04-21  2:07     ` Stephen Rothwell
2012-04-28  9:04   ` tip-bot for Thomas Gleixner [this message]
2012-04-20 13:05 ` [patch 04/18] smp: Provide generic idle thread allocation Thomas Gleixner
2012-04-20 13:05   ` Thomas Gleixner
2012-04-20 16:21   ` Sam Ravnborg
2012-04-20 16:21     ` Sam Ravnborg
2012-04-20 18:55     ` Thomas Gleixner
2012-04-20 18:55       ` Thomas Gleixner
2012-04-21  2:20   ` Stephen Rothwell
2012-04-21  2:20     ` Stephen Rothwell
2012-04-21  2:25   ` Frank Rowand
2012-04-21  2:25     ` Frank Rowand
2012-04-28  9:05   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 05/18] x86: Add task_struct argument to smp_ops.cpu_up Thomas Gleixner
2012-04-28  9:05   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 06/18] x86: Use generic idle thread allocation Thomas Gleixner
2012-04-28  9:06   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 07/18] powerpc: " Thomas Gleixner
2012-04-28  9:07   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-28 22:51     ` Benjamin Herrenschmidt
2012-04-20 13:05 ` [patch 08/18] ia64: " Thomas Gleixner
2012-04-28  9:08   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 09/18] arm: " Thomas Gleixner
2012-04-28  9:09   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 11/18] hexagon: " Thomas Gleixner
2012-04-24 16:47   ` Richard Kuo
2012-04-28  9:10   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 10/18] mips: " Thomas Gleixner
2012-04-28  9:10   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 12/18] s390: " Thomas Gleixner
2012-04-23  7:09   ` Martin Schwidefsky
2012-04-28  9:11   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 13/18] blackfin: " Thomas Gleixner
2012-04-28  9:13   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 14/18] cris: " Thomas Gleixner
2012-04-23  7:57   ` Jesper Nilsson
2012-04-28  9:12   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 15/18] sh: " Thomas Gleixner
2012-04-21  3:18   ` Paul Mundt
2012-04-28  9:14   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 16/18] alpha: " Thomas Gleixner
2012-04-28  9:15   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 17/18] parisc: " Thomas Gleixner
2012-04-28  9:16   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:05 ` [patch 18/18] sparc: " Thomas Gleixner
2012-04-22 19:52   ` David Miller
2012-04-28  9:15   ` [tip:smp/hotplug] " tip-bot for Thomas Gleixner
2012-04-20 13:16 ` [patch 00/18] SMP: Boot and CPU hotplug refactoring - Part 1 Thomas Gleixner
2012-04-20 13:21 ` Peter Zijlstra
2012-04-20 13:47   ` Thomas Gleixner
2012-04-21  0:08     ` Suresh Siddha
2012-05-03  9:41       ` Thomas Gleixner
2012-05-03 23:42         ` Suresh Siddha
2012-05-03 17:43       ` [tip:smp/hotplug] smp, idle: Allocate idle thread for each possible cpu during boot tip-bot for Suresh Siddha
2012-04-20 15:42   ` [patch 00/18] SMP: Boot and CPU hotplug refactoring - Part 1 Tejun Heo
2012-04-20 15:49     ` Peter Zijlstra
2012-04-20 15:56       ` Thomas Gleixner
2012-04-20 13:56 ` Srivatsa S. Bhat
2012-04-20 14:18   ` Thomas Gleixner
2012-04-24 18:44     ` Konrad Rzeszutek Wilk
2012-05-21  1:42     ` Rusty Russell
2012-05-21  8:25       ` Thomas Gleixner
2012-05-22  0:53         ` Rusty Russell
2012-04-20 14:06 ` richard -rw- weinberger
2012-04-20 14:19   ` Thomas Gleixner
2012-04-20 14:27 ` James Bottomley
2012-04-20 17:55 ` Paul E. McKenney
2012-04-20 23:11 ` Venki Pallipadi
2012-04-21  1:04 ` Frank Rowand
2012-04-21  1:55   ` Frank Rowand
2012-04-22 21:01 ` Chris Metcalf
2012-04-22 21:01   ` Chris Metcalf
2012-04-22 21:01   ` Chris Metcalf
2012-04-30  8:05 ` Santosh Shilimkar

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=tip-38498a67aa2cf8c80754b8d304bfacc10bc582b5@git.kernel.org \
    --to=tglx@linutronix.de \
    --cc=benh@kernel.crashing.org \
    --cc=cmetcalf@tilera.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jejb@parisc-linux.org \
    --cc=jesper.nilsson@axis.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mattst88@gmail.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=ralf@linux-mips.org \
    --cc=richard@nod.at \
    --cc=rkuo@codeaurora.org \
    --cc=rusty@rustcorp.com.au \
    --cc=schwidefsky@de.ibm.com \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=takata@linux-m32r.org \
    --cc=tony.luck@intel.com \
    --cc=vapier@gentoo.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.