linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Venkatesh Pallipadi <venki@google.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>,
	Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Aaron Durbin <adurbin@google.com>, Paul Turner <pjt@google.com>,
	Yong Zhang <yong.zhang0@gmail.com>,
	linux-kernel@vger.kernel.org, Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: [PATCH 5/5] s390: Use common fork_idle_from_wq in smpboot
Date: Wed, 7 Mar 2012 08:00:00 +0100	[thread overview]
Message-ID: <20120307070000.GA4426@osiris.boeblingen.de.ibm.com> (raw)
In-Reply-To: <1331070074-31717-6-git-send-email-venki@google.com>

On Tue, Mar 06, 2012 at 01:41:14PM -0800, Venkatesh Pallipadi wrote:
> Cleanup. Instead of reimplementing fork_idle on wq and idle task caching,
> use fork_idle_from_wq().
> 
> Signed-off-by: Venkatesh Pallipadi <venki@google.com>
> ---
>  arch/s390/kernel/smp.c |   38 +++++---------------------------------
>  1 files changed, 5 insertions(+), 33 deletions(-)

Your patch won't apply on linux-next because of rather large code changes.
Anyway see below a patch that applies cleanly (and works) on s390.
Thanks for cleaning this up!

Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>

---
 arch/s390/kernel/smp.c |   36 +++++-------------------------------
 1 file changed, 5 insertions(+), 31 deletions(-)

--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -83,7 +83,6 @@ enum {
 
 struct pcpu {
 	struct cpu cpu;
-	struct task_struct *idle;	/* idle process for the cpu */
 	struct _lowcore *lowcore;	/* lowcore page(s) for the cpu */
 	unsigned long async_stack;	/* async stack for the cpu */
 	unsigned long panic_stack;	/* panic stack for the cpu */
@@ -724,26 +723,10 @@ static void __cpuinit smp_start_secondar
 	cpu_idle();
 }
 
-struct create_idle {
-	struct work_struct work;
-	struct task_struct *idle;
-	struct completion done;
-	int cpu;
-};
-
-static void __cpuinit smp_fork_idle(struct work_struct *work)
-{
-	struct create_idle *c_idle;
-
-	c_idle = container_of(work, struct create_idle, work);
-	c_idle->idle = fork_idle(c_idle->cpu);
-	complete(&c_idle->done);
-}
-
 /* Upping and downing of CPUs */
 int __cpuinit __cpu_up(unsigned int cpu)
 {
-	struct create_idle c_idle;
+	struct task_struct *idle;
 	struct pcpu *pcpu;
 	int rc;
 
@@ -753,22 +736,14 @@ int __cpuinit __cpu_up(unsigned int cpu)
 	if (pcpu_sigp_retry(pcpu, sigp_initial_cpu_reset, 0) !=
 	    sigp_order_code_accepted)
 		return -EIO;
-	if (!pcpu->idle) {
-		c_idle.done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done);
-		INIT_WORK_ONSTACK(&c_idle.work, smp_fork_idle);
-		c_idle.cpu = cpu;
-		schedule_work(&c_idle.work);
-		wait_for_completion(&c_idle.done);
-		if (IS_ERR(c_idle.idle))
-			return PTR_ERR(c_idle.idle);
-		pcpu->idle = c_idle.idle;
-	}
-	init_idle(pcpu->idle, cpu);
+	idle = fork_idle_from_wq(cpu);
+	if (IS_ERR(idle))
+		return PTR_ERR(idle);
 	rc = pcpu_alloc_lowcore(pcpu, cpu);
 	if (rc)
 		return rc;
 	pcpu_prepare_secondary(pcpu, cpu);
-	pcpu_attach_task(pcpu, pcpu->idle);
+	pcpu_attach_task(pcpu, idle);
 	pcpu_start_fn(pcpu, smp_start_secondary, NULL);
 	while (!cpu_online(cpu))
 		cpu_relax();
@@ -855,7 +830,6 @@ void __init smp_prepare_boot_cpu(void)
 	struct pcpu *pcpu = pcpu_devices;
 
 	boot_cpu_address = stap();
-	pcpu->idle = current;
 	pcpu->state = CPU_STATE_CONFIGURED;
 	pcpu->address = boot_cpu_address;
 	pcpu->lowcore = (struct _lowcore *)(unsigned long) store_prefix();


  reply	other threads:[~2012-03-07  7:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23  0:36 [PATCH] Extend mwait idle to optimize away CAL and RES interrupts to an idle CPU -v1 Venkatesh Pallipadi
2012-02-23  7:50 ` Ingo Molnar
2012-02-23  9:08   ` Peter Zijlstra
2012-02-23 20:04     ` Venki Pallipadi
2012-02-23 20:03   ` Venki Pallipadi
2012-03-02  0:33   ` Venki Pallipadi
2012-03-02  1:28     ` Suresh Siddha
2012-03-02  1:35       ` Venki Pallipadi
2012-03-02  1:37         ` Suresh Siddha
2012-03-02  2:00           ` Venki Pallipadi
2012-03-02  7:21             ` Ingo Molnar
2012-03-02 17:41               ` Suresh Siddha
2012-03-06 21:41                 ` fork_idle from wq cleanup Venkatesh Pallipadi
2012-03-06 21:41                   ` [PATCH 1/5] x86: Move fork_idle from wq and idle caching to common code Venkatesh Pallipadi
2012-03-06 21:41                   ` [PATCH 2/5] ia64: Use common fork_idle_from_wq in smpboot Venkatesh Pallipadi
2012-03-06 21:41                   ` [PATCH 3/5] mips: " Venkatesh Pallipadi
2012-03-06 22:51                     ` Ralf Baechle
2012-03-06 21:41                   ` [PATCH 4/5] powerpc: " Venkatesh Pallipadi
2012-03-06 21:41                   ` [PATCH 5/5] s390: " Venkatesh Pallipadi
2012-03-07  7:00                     ` Heiko Carstens [this message]
2012-03-07  6:06                   ` fork_idle from wq cleanup Suresh Siddha
2012-02-23  9:30 ` [PATCH] Extend mwait idle to optimize away CAL and RES interrupts to an idle CPU -v1 Peter Zijlstra
2012-02-23 19:34   ` Venki Pallipadi
2012-02-24  5:41     ` Yong Zhang
2012-02-24  6:13       ` Yong Zhang
2012-02-27  8:38         ` Peter Zijlstra
2012-02-27  9:08           ` Yong Zhang
2012-02-27  9:30             ` Peter Zijlstra
2012-02-27  9:51               ` Yong Zhang
2012-02-26  1:32       ` Paul E. McKenney
2012-02-27  9:06         ` Yong Zhang
2012-02-27 17:05           ` Paul E. McKenney
2012-02-28  7:12             ` Yong Zhang
2012-02-28 13:05               ` Paul E. McKenney
2012-02-29  6:36                 ` Yong Zhang
2012-02-27  8:45     ` Peter Zijlstra
2012-02-27 18:17       ` Venki Pallipadi

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=20120307070000.GA4426@osiris.boeblingen.de.ibm.com \
    --to=heiko.carstens@de.ibm.com \
    --cc=adurbin@google.com \
    --cc=benh@kernel.crashing.org \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=ralf@linux-mips.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=venki@google.com \
    --cc=yong.zhang0@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).