Messages in this thread |  | | Date | Mon, 28 Aug 2000 19:56:09 -0700 (PDT) | From | Dimitris Michailidis <> | Subject | RE: [patch] scheduler bugfix, SMP, 2.4.0-test7 |
| |
On 28-Aug-2000 Linus Torvalds wrote: > I think the right solution is to completely split up "schedule()" into two > different functions (which just share 99% of the code), and basically have > the idle thread call the _other_ schedule. The one that never does the > test at all. > > That way you know statically whether you are the idle thread or not. No > test at all.
I thought about it some more. Yes, I can tell statically if I am the idle thread or not, but how do I tell if the process that was running before me on the CPU is the idle thread? That's what __schedule_tail() cares about, prev. If we have a separate schedule for idlers they can avoid the test in their __schedule_tail but the generic case still has to check. As far as I can tell having a separate schedule would allow idle threads to skip some of the early tests in schedule() but I doubt it makes sense from a cache footprint POV.
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.
-- Dimitris Michailidis dimitris@engr.sgi.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
|  |