[lkml]   [2000]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRE: [patch] scheduler bugfix, SMP, 2.4.0-test7

On Mon, 28 Aug 2000, Dimitris Michailidis wrote:

> Speaking of footprints, that reschedule_idle should really be turned into a
> FASTCALL. It's large and inlining creates too many copies in frequently
> executed code. __wake_up() even has two of them, check how large it is some
> time.

i agree fully. The attached patch against test8-pre1 changes
schedule_idle() from inline to FASTCALL - things look much nicer with this
one applied.

the patch's second half adds the check for need_resched after schedule().
IMO this is needed not only for (admittedly secondary reason of) latency,
but for correctness as well: schedule_idle() might have preempted the
current process (even if both processes are non-idle), so checking for
need_resched is needed for robustness.

--- linux/kernel/sched.c.orig Tue Aug 29 11:39:00 2000
+++ linux/kernel/sched.c Tue Aug 29 11:41:33 2000
@@ -213,7 +213,9 @@
* This function must be inline as anything that saves and restores
* flags has to do so within the same register window on sparc (Anton)
-static inline void reschedule_idle(struct task_struct * p, unsigned long flags)
+static FASTCALL(void reschedule_idle(struct task_struct *, unsigned long));
+static void reschedule_idle(struct task_struct * p, unsigned long flags)
int this_cpu = smp_processor_id();
@@ -656,6 +658,9 @@

+ if (current->need_resched)
+ goto tq_scheduler_back;

 \ /
  Last update: 2005-03-22 12:38    [W:0.172 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site