public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Linux v2.5.29
Date: Sat, 27 Jul 2002 16:26:04 +1000	[thread overview]
Message-ID: <20020727162604.433daec3.rusty@rustcorp.com.au> (raw)
In-Reply-To: <Pine.LNX.4.33.0207262004550.1357-100000@penguin.transmeta.com>

On Fri, 26 Jul 2002 20:12:00 -0700 (PDT)
Linus Torvalds <torvalds@transmeta.com> wrote:

> 
> Hmm.. All over the map. IDE patches as usual, USB updates, tons of C99 
> named initializers work, ACPI update, fixes from Alan, driverfs race fixes
> and cleanups, SCSI driver fixes from Doug and tons of input layer updates.
> 
> Oh, and a new LDM driver, Rusty's CPU hotplug infrastructure

Badly broken on SMP by Linus.

You'll only get one migration thread, and one ksoftirqd.

Issue is that some initcalls (softirq.c and sched.c) are way easier before
other CPUs are brought up, but doing it the other way broke AGP and Linus
decided to call all the initcalls after CPUs are brought up in case someone
else needed it (I still strongly disagree).

This hack fixes it: real fix is the explicit initcall ordering patch,
which Linus hasn't commented on 8(

Name: Hot-plug CPU Boot ksoftirqd and migration fix
Author: Rusty Russell
Status: Tested on 2.5.29, x86 SMP

D: This patch fixes the calls to initialize ksoftirqd and the
D: migration threads.  This really should be done by the initcall
D: depends patch.

diff -urNp -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.29/init/main.c working-2.5.29/init/main.c
--- linux-2.5.29/init/main.c	Sat Jul 27 15:24:39 2002
+++ working-2.5.29/init/main.c	Sat Jul 27 16:09:42 2002
@@ -524,6 +524,15 @@ static void __init do_basic_setup(void)
 	do_initcalls();
 }
 
+static void do_pre_smp_initcalls(void)
+{
+	extern int migration_init(void);
+	extern int spawn_ksoftirqd(void);
+
+	migration_init();
+	spawn_ksoftirqd();
+}
+
 extern void prepare_namespace(void);
 
 static int init(void * unused)
@@ -533,6 +542,9 @@ static int init(void * unused)
 	lock_kernel();
 	/* Sets up cpus_possible() */
 	smp_prepare_cpus(max_cpus);
+
+	do_pre_smp_initcalls();
+
 	smp_init();
 	do_basic_setup();
 
diff -urNp -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.29/kernel/sched.c working-2.5.29/kernel/sched.c
--- linux-2.5.29/kernel/sched.c	Sat Jul 27 15:24:39 2002
+++ working-2.5.29/kernel/sched.c	Sat Jul 27 16:21:58 2002
@@ -1894,6 +1894,8 @@ static int migration_call(struct notifie
 		       (long)hcpu);
 		kernel_thread(migration_thread, hcpu,
 			      CLONE_FS | CLONE_FILES | CLONE_SIGNAL);
+		while (!cpu_rq((long)hcpu)->migration_thread)
+			yield();
 		break;
 	}
 	return NOTIFY_OK;
@@ -1901,7 +1903,7 @@ static int migration_call(struct notifie
 
 static struct notifier_block migration_notifier = { &migration_call, NULL, 0 };
 
-int __init migration_init(void)
+__init int migration_init(void)
 {
 	/* Start one for boot CPU. */
 	migration_call(&migration_notifier, CPU_ONLINE,
@@ -1910,7 +1912,6 @@ int __init migration_init(void)
 	return 0;
 }
 
-__initcall(migration_init);
 #endif
 
 extern void init_timervecs(void);
diff -urNp -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.29/kernel/softirq.c working-2.5.29/kernel/softirq.c
--- linux-2.5.29/kernel/softirq.c	Sat Jul 27 15:24:39 2002
+++ working-2.5.29/kernel/softirq.c	Sat Jul 27 16:07:53 2002
@@ -410,11 +410,9 @@ static int __devinit cpu_callback(struct
 
 static struct notifier_block cpu_nfb = { &cpu_callback, NULL, 0 };
 
-static __init int spawn_ksoftirqd(void)
+__init int spawn_ksoftirqd(void)
 {
 	cpu_callback(&cpu_nfb, CPU_ONLINE, (void *)smp_processor_id());
 	register_cpu_notifier(&cpu_nfb);
 	return 0;
 }
-
-__initcall(spawn_ksoftirqd);


-- 
   there are those who do and those who hang on and you don't see too
   many doers quoting their contemporaries.  -- Larry McVoy

  parent reply	other threads:[~2002-07-27  6:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-27  3:12 Linux v2.5.29 Linus Torvalds
2002-07-27  3:23 ` Linus Torvalds
2002-07-27  6:26 ` Rusty Russell [this message]
2002-07-27  9:06 ` 2.5.29: oops on boot Ville Herva
2002-07-27  9:33   ` Ville Herva
2002-07-27 11:40 ` Linux v2.5.29 Peter Osterlund
2002-07-29 19:27 ` [PATCH] 2.5.29 IDE 108 Marcin Dalecki
2002-07-30 11:02   ` Alan Cox
2002-07-30  9:45     ` Marcin Dalecki
2002-07-29 20:51 ` [PATCH] 2.5.29 IDE 109 Marcin Dalecki
2002-07-30 10:59   ` Alan Cox
2002-07-30  9:51     ` Marcin Dalecki
     [not found] <3D42433C.C3BB8F4D@zip.com.au>
2002-07-27  7:12 ` Linux v2.5.29 Rusty Russell

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=20020727162604.433daec3.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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