mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: vatsa@in.ibm.com
Cc: rusty@au1.ibm.com, mingo@elte.hu, nickpiggin@yahoo.com.au,
	linux-kernel@vger.kernel.org, lhcs-devel@lists.sourceforge.net
Subject: Re: CPU Hotplug broken -mm5 onwards
Date: Thu, 22 Apr 2004 00:03:08 -0700	[thread overview]
Message-ID: <20040422000308.4ba47e03.akpm@osdl.org> (raw)
In-Reply-To: <20040421164436.GA11760@in.ibm.com>

Srivatsa Vaddagiri <vatsa@in.ibm.com> wrote:
>
> Anyway patch below addresses the above races. Its against 2.6.6-rc2-mm1
>  and has been tested on a 4way Intel Pentium SMP m/c. I have added a
>  cpu_is_offlince check in migration_thread(). If that is true, migration
>  thread stop processing and just waits for kthread_stop.

I'll take the stunned silence as agreement ;)

It needed a warning fixup:

kernel/sched.c: In function `migration_call':
kernel/sched.c:3648: warning: unused variable `tmp'
kernel/sched.c:3648: warning: unused variable `req'
kernel/sched.c:3647: warning: unused variable `head'

---

 25-akpm/kernel/sched.c |   44 ++++++++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 20 deletions(-)

diff -puN kernel/sched.c~sched-remove_hotplug_lock_in_sched_migrate_task-warnings kernel/sched.c
--- 25/kernel/sched.c~sched-remove_hotplug_lock_in_sched_migrate_task-warnings	2004-04-21 23:56:43.736745848 -0700
+++ 25-akpm/kernel/sched.c	2004-04-21 23:58:42.628671528 -0700
@@ -3339,8 +3339,6 @@ static int migration_call(struct notifie
 	struct task_struct *p;
 	struct runqueue *rq;
 	unsigned long flags;
-	struct list_head *head;
-	migration_req_t *req, *tmp;
 
 	switch (action) {
 	case CPU_UP_PREPARE:
@@ -3363,25 +3361,31 @@ static int migration_call(struct notifie
 		/* Unbind it from offline cpu so it can run.  Fall thru. */
 		kthread_bind(cpu_rq(cpu)->migration_thread,smp_processor_id());
 	case CPU_DEAD:
-		rq = cpu_rq(cpu);
-		head = &rq->migration_queue;
-		spin_lock_irq(&rq->lock);
-		list_for_each_entry_safe(req, tmp, head, list) {
-
-			BUG_ON(req->type != REQ_MOVE_TASK);
-
-			list_del_init(&req->list);
-
-			/* No need to migrate the task in the request. It would
-	 		 * have already been migrated (maybe to a different
-			 * CPU). Just wake up the requestor.
-			 */
-			complete(&req->done);
+		{
+			struct list_head *head;
+			migration_req_t *req, *tmp;
+
+			rq = cpu_rq(cpu);
+			head = &rq->migration_queue;
+			spin_lock_irq(&rq->lock);
+			list_for_each_entry_safe(req, tmp, head, list) {
+
+				BUG_ON(req->type != REQ_MOVE_TASK);
+
+				list_del_init(&req->list);
+
+				/*
+				 * No need to migrate the task in the request.
+				 * It would have already been migrated (maybe to
+				 * a different CPU). Just wake up the requestor
+				 */
+				complete(&req->done);
+			}
+			spin_unlock_irq(&rq->lock);
+			kthread_stop(cpu_rq(cpu)->migration_thread);
+			cpu_rq(cpu)->migration_thread = NULL;
+	 		BUG_ON(cpu_rq(cpu)->nr_running != 0);
 		}
-		spin_unlock_irq(&rq->lock);
-		kthread_stop(cpu_rq(cpu)->migration_thread);
-		cpu_rq(cpu)->migration_thread = NULL;
- 		BUG_ON(cpu_rq(cpu)->nr_running != 0);
  		break;
 #endif
 	}

_


      reply	other threads:[~2004-04-22  7:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-18 17:06 Srivatsa Vaddagiri
2004-04-19  3:34 ` Nick Piggin
2004-04-19 12:58   ` [lhcs-devel] " Srivatsa Vaddagiri
2004-04-19 22:55     ` Nick Piggin
2004-04-19 23:07       ` Rusty Russell
     [not found] ` <20040421023650.24b9f85a.akpm@osdl.org>
     [not found]   ` <20040421095939.GB10767@in.ibm.com>
2004-04-21 16:44     ` Srivatsa Vaddagiri
2004-04-22  7:03       ` Andrew Morton [this message]

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=20040422000308.4ba47e03.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=lhcs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=rusty@au1.ibm.com \
    --cc=vatsa@in.ibm.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

Powered by JetHome