Messages in this thread Patch in this message |  | | Date | Tue, 29 Aug 2000 12:04:37 +0200 (CEST) | From | Ingo Molnar <> | Subject | RE: [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.
Ingo --- 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) { #ifdef CONFIG_SMP int this_cpu = smp_processor_id(); @@ -656,6 +658,9 @@ same_process: reacquire_kernel_lock(current); + if (current->need_resched) + goto tq_scheduler_back; + return; recalculate:
|  |