mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch] scheduler fixes, 2.5.32-BK
@ 2002-08-30  7:43 Ingo Molnar
  2002-08-30  7:55 ` Ingo Molnar
  0 siblings, 1 reply; 11+ messages in thread
From: Ingo Molnar @ 2002-08-30  7:43 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Andrew Morton


the attached patch adds two scheduler related fixes:

 - changes the migration code to use struct completion. Andrew pointed out
   that there might be a small window in where the up() touches the
   semaphore while the waiting task goes on and frees its stack. And
   completion is more suited for this kind of stuff anyway.

 - removes two unneeded exports, pointed out by Andrew.

	Ingo

--- linux/kernel/sched.c.orig	Fri Aug 30 09:34:34 2002
+++ linux/kernel/sched.c	Fri Aug 30 09:35:49 2002
@@ -1901,7 +1901,7 @@
 typedef struct {
 	list_t list;
 	task_t *task;
-	struct semaphore sem;
+	struct completion done;
 } migration_req_t;
 
 /*
@@ -1945,13 +1945,13 @@
 		task_rq_unlock(rq, &flags);
 		goto out;
 	}
-	init_MUTEX_LOCKED(&req.sem);
+	init_completion(&req.done);
 	req.task = p;
 	list_add(&req.list, &rq->migration_queue);
 	task_rq_unlock(rq, &flags);
 	wake_up_process(rq->migration_thread);
 
-	down(&req.sem);
+	wait_for_completion(&req.done);
 out:
 	preempt_enable();
 }
@@ -2032,7 +2032,7 @@
 		double_rq_unlock(rq_src, rq_dest);
 		local_irq_restore(flags);
 
-		up(&req->sem);
+		complete(&req->done);
 	}
 }
 
--- linux/kernel/ksyms.c.orig	Fri Aug 30 09:37:36 2002
+++ linux/kernel/ksyms.c	Fri Aug 30 09:37:38 2002
@@ -496,8 +496,6 @@
 #endif
 
 EXPORT_SYMBOL(kstat);
-EXPORT_SYMBOL(nr_running);
-EXPORT_SYMBOL(nr_context_switches);
 
 /* misc */
 EXPORT_SYMBOL(panic);



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-08-30 17:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-30  7:43 [patch] scheduler fixes, 2.5.32-BK Ingo Molnar
2002-08-30  7:55 ` Ingo Molnar
2002-08-30  8:12   ` Andrew Morton
2002-08-30  8:22     ` Ingo Molnar
2002-08-30 17:03   ` Linus Torvalds
2002-08-30 17:05     ` Ingo Molnar
2002-08-30 17:16       ` Ingo Molnar
2002-08-30 17:19       ` Linus Torvalds
2002-08-30 17:28         ` Ingo Molnar
2002-08-30 17:47           ` Linus Torvalds
2002-08-30 18:05             ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®