All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Jesse Barnes <jbarnes@engr.sgi.com>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Nick Piggin <nickpiggin@yahoo.com.au>
Subject: Re: 2.6.8-rc3-mm2
Date: Mon, 9 Aug 2004 23:34:45 -0700	[thread overview]
Message-ID: <20040810063445.GE11200@holomorphy.com> (raw)
In-Reply-To: <20040809224546.GZ11200@holomorphy.com>

On Mon, Aug 09, 2004 at 12:53:23PM -0700, William Lee Irwin III wrote:
>>>> I can reproduce here (ia64/Altix). Fixing.

On Mon, Aug 09, 2004 at 01:43:57PM -0700, William Lee Irwin III wrote:
>>> It comes up with the following applied. Now distilling into a bugfix.

On Mon, Aug 09, 2004 at 02:10:42PM -0700, William Lee Irwin III wrote:
>> The following does *NOT* come up. The difference appears to be the delay
>> from the printk()'s.

On Mon, Aug 09, 2004 at 03:45:46PM -0700, William Lee Irwin III wrote:
> Adding mdelay(1000) before and after the wakeup IPI didn't help. Must
> be something else going on in printk().

None of the printk()'s in do_boot_cpu() appear essential. The following
also boots:


--- mm2-2.6.8-rc3/arch/ia64/kernel/smpboot.c.orig	2004-08-10 13:42:38.000000000 -0700
+++ mm2-2.6.8-rc3/arch/ia64/kernel/smpboot.c	2004-08-09 23:06:44.000000000 -0700
@@ -356,65 +356,45 @@
 	return cpu_idle();
 }
 
-struct create_idle {
-	struct task_struct *idle;
-	struct completion done;
-	int cpu;
-};
-
-void
-do_fork_idle(void *_c_idle)
-{
-	struct create_idle *c_idle = _c_idle;
-
-	c_idle->idle = fork_idle(c_idle->cpu);
-	complete(&c_idle->done);
-}
-
 static int __devinit
 do_boot_cpu (int sapicid, int cpu)
 {
 	int timeout;
-	struct create_idle c_idle = {
-		.cpu	= cpu,
-		.done	= COMPLETION_INITIALIZER(c_idle.done),
-	};
-	DECLARE_WORK(work, do_fork_idle, &c_idle);
 	/*
 	 * We can't use kernel_thread since we must avoid to reschedule the child.
 	 */
-	if (!keventd_up() || current_is_keventd())
-		work.func(work.data);
-	else {
-		schedule_work(&work);
-		wait_for_completion(&c_idle.done);
-	}
-
-	if (IS_ERR(c_idle.idle))
-		panic("failed fork for CPU %d", cpu);
-	task_for_booting_cpu = c_idle.idle;
-
-	Dprintk("Sending wakeup vector %lu to AP 0x%x/0x%x.\n", ap_wakeup_vector, cpu, sapicid);
-
+	/* printk("entered do_boot_cpu(%d, %d)\n", sapicid, cpu); */
+	/* printk("about to fork_idle(%d)\n", cpu); */
+	task_for_booting_cpu = fork_idle(cpu);
+	/* printk("survived fork_idle(%d)\n", cpu); */
+	if (IS_ERR(task_for_booting_cpu))
+		 panic("failed fork for CPU %d", cpu);
+	mb();
+	/* printk("Sending wakeup vector %lu to AP 0x%x/0x%x.\n", ap_wakeup_vector, cpu, sapicid); */
+	/* printk("about to platform_send_ipi(%u, 0x%lx, IA64_IPI_DM_INT, 0)\n", cpu, ap_wakeup_vector); */
 	platform_send_ipi(cpu, ap_wakeup_vector, IA64_IPI_DM_INT, 0);
+	/* printk("survived platform_send_ipi(%u, 0x%lx, IA64_IPI_DM_INT, 0)\n", cpu, ap_wakeup_vector); */
 
 	/*
 	 * Wait 10s total for the AP to start
 	 */
-	Dprintk("Waiting on callin_map ...");
+	/* printk("Waiting on callin_map on cpu %d for cpu %d...", smp_processor_id(), cpu); */
 	for (timeout = 0; timeout < 100000; timeout++) {
 		if (cpu_isset(cpu, cpu_callin_map))
 			break;  /* It has booted */
 		udelay(100);
 	}
-	Dprintk("\n");
+	/* printk("\n"); */
+	/* printk("finished waiting on callin_map\n"); */
 
 	if (!cpu_isset(cpu, cpu_callin_map)) {
-		printk(KERN_ERR "Processor 0x%x/0x%x is stuck.\n", cpu, sapicid);
+		/* printk("Processor 0x%x/0x%x is stuck.\n", cpu, sapicid); */
 		ia64_cpu_to_sapicid[cpu] = -1;
 		cpu_clear(cpu, cpu_online_map);  /* was set in smp_callin() */
+		/* printk("error return from do_boot_cpu(%d, %d)\n", sapicid, cpu); */
 		return -EINVAL;
-	}
+	} /* else printk("Processor %d/%d came up\n", cpu, sapicid); */
+	/* printk("normal return from do_boot_cpu(%d, %d)\n", sapicid, cpu); */
 	return 0;
 }
 
@@ -655,26 +635,40 @@
 	int ret;
 	int sapicid;
 
+	printk("entered __cpu_up(%u)\n", cpu);
 	sapicid = ia64_cpu_to_sapicid[cpu];
-	if (sapicid == -1)
+	if (sapicid == -1) {
+		printk("invalid SAPIC ID\n");
+		printk("error return from __cpu_up(%u)\n", cpu);
 		return -EINVAL;
+	}
 
 	/*
 	 * Already booted.. just enable and get outa idle lool
 	 */
 	if (cpu_isset(cpu, cpu_callin_map))
 	{
+		printk("%u already set in cpu_callin_map\n", cpu);
+		printk("about to cpu_enable(%u)\n", cpu);
 		cpu_enable(cpu);
+		printk("survived cpu_enable(%u)\n", cpu);
 		local_irq_enable();
+		printk("looping while (!cpu_isset(%u, cpu_online_map))\n", cpu);
 		while (!cpu_isset(cpu, cpu_online_map))
 			mb();
+		printk("finished looping while (!cpu_isset(%u, cpu_online_map))\n", cpu);
+		printk("successful return from __cpu_up(%u)\n", cpu);
 		return 0;
 	}
 	/* Processor goes to start_secondary(), sets online flag */
+	printk("about to call do_boot_cpu(%d, %d)\n", sapicid, cpu);
 	ret = do_boot_cpu(sapicid, cpu);
-	if (ret < 0)
+	printk("survived call to do_boot_cpu(%d, %d)\n", sapicid, cpu);
+	if (ret < 0) {
+		printk("error return from __cpu_up(%u)\n", cpu);
 		return ret;
-
+	}
+	printk("successful return from __cpu_up(%u)\n", cpu);
 	return 0;
 }
 
--- mm2-2.6.8-rc3/kernel/fork.c.orig	2004-08-10 06:02:27.000000000 -0700
+++ mm2-2.6.8-rc3/kernel/fork.c	2004-08-10 13:37:23.000000000 -0700
@@ -1190,7 +1190,7 @@
 	goto fork_out;
 }
 
-task_t * __init fork_idle(int cpu)
+task_t *fork_idle(int cpu)
 {
 	task_t *task;
 	struct pt_regs regs;

  reply	other threads:[~2004-08-10  6:35 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-08 22:29 2.6.8-rc3-mm2 Andrew Morton
2004-08-08 22:55 ` 2.6.8-rc3-mm2 Brice Goglin
2004-08-08 23:04   ` 2.6.8-rc3-mm2 Andrew Morton
2004-08-08 23:17     ` 2.6.8-rc3-mm2 Andrew Morton
2004-08-09  2:17 ` [patch] 2.6.8-rc3-mm2: sk98lin/skge.c doesn't compile with PROC_FS=n Adrian Bunk
2004-08-09  5:14 ` 2.6.8-rc3-mm2 (compile stats) John Cherry
2004-08-09  8:20 ` 2.6.8-rc3-mm2 Rick Lindsley
2004-08-09  8:25   ` 2.6.8-rc3-mm2 Andrew Morton
2004-08-09  8:29   ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-09  8:33     ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-09  8:43 ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-09  8:49 ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-09 10:36 ` 2.6.8-rc3-mm2 Espen Fjellvær Olsen
2004-08-09 12:14   ` 2.6.8-rc3-mm2 Vladimir V. Saveliev
2004-08-09 17:51   ` 2.6.8-rc3-mm2 Hans Reiser
2004-08-09 17:50 ` 2.6.8-rc3-mm2 Johannes Stezenbach
2004-08-09 18:22 ` 2.6.8-rc3-mm2 Jesse Barnes
2004-08-09 18:25   ` 2.6.8-rc3-mm2 Andrew Morton
2004-08-09 18:32     ` 2.6.8-rc3-mm2 Jesse Barnes
2004-08-09 19:17       ` 2.6.8-rc3-mm2 Jesse Barnes
2004-08-09 19:53         ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-09 20:43           ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-09 21:10             ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-09 22:45               ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10  6:34                 ` William Lee Irwin III [this message]
2004-08-10  8:02                   ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10  8:30                     ` 2.6.8-rc3-mm2 Ingo Molnar
2004-08-10  8:56                       ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10  9:00                         ` 2.6.8-rc3-mm2 Ingo Molnar
2004-08-10  9:06                           ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10  8:04                   ` 2.6.8-rc3-mm2 Ingo Molnar
2004-08-10  8:08                     ` 2.6.8-rc3-mm2 Ingo Molnar
2004-08-10  8:17                       ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10  8:23                         ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10  9:00                     ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10  9:38                       ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10 10:02                         ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10 11:53                           ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10 12:52                             ` 2.6.8-rc3-mm2 V13
2004-08-10 12:51                               ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10 12:55                                 ` 2.6.8-rc3-mm2 Ingo Molnar
2004-08-10 12:56                                   ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10 13:01                                     ` 2.6.8-rc3-mm2 Ingo Molnar
2004-08-10 13:10                                       ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10 13:12                                       ` 2.6.8-rc3-mm2 Russell King
2004-08-10 13:16                                         ` 2.6.8-rc3-mm2 Ingo Molnar
2004-08-10 13:39                                           ` 2.6.8-rc3-mm2 Russell King
2004-08-10 13:48                                             ` 2.6.8-rc3-mm2 Ingo Molnar
2004-08-10  6:32 ` 2.6.8-rc3-mm2 William Lee Irwin III
2004-08-10  8:34 ` 2.6.8-rc3-mm2 Rick Lindsley
2004-08-10 14:55   ` 2.6.8-rc3-mm2 Martin J. Bligh

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=20040810063445.GE11200@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=jbarnes@engr.sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    /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.