From: george anzinger <george@mvista.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Benjamin LaHaise <bcrl@redhat.com>,
Linus Torvalds <torvalds@transmeta.com>,
linux-kernel@vger.kernel.org
Subject: Re: Context switch times
Date: Fri, 05 Oct 2001 10:49:04 -0700 [thread overview]
Message-ID: <3BBDF290.E3988F49@mvista.com> (raw)
In-Reply-To: <E15pWfR-0006g5-00@the-village.bc.nu>
Alan Cox wrote:
>
> > I don't quite agree with you that it doesn't matter. A lot of tests
> > (volanomark, other silly things) show that the current scheduler jumps
> > processes from CPU to CPU on SMP boxes far too easily, in addition to the
> > lengthy duration of run queue processing when loaded down. Yes, these
> > applications are leaving too many runnable processes around, but that's
> > the way some large app server loads behave. And right now it makes linux
> > look bad compared to other OSes.
>
> The current scheduler is completely hopeless by the time you hit 3
> processors and a bit flaky on two. Its partly the algorithm and partly
> implementation
>
> #1 We schedule tasks based on a priority that has no cache
> consideration
>
> #2 We have an O(tasks) loop refreshing priority that isnt needed
> (Montavista fix covers this)
>
> #3 We have an O(runnable) loop which isnt ideal
>
> #4 On x86 we are horribly cache pessimal. All the task structs are
> on the same cache colour. Multiple tasks waiting for the same event
> put their variables (like the wait queue) on the same cache line.
>
> The poor cache performance greatly comes from problem 1. Because we prioritize
> blindly on CPU usage with a tiny magic constant fudge factor we are
> executing totally wrong task orders. Instead we need to schedule for cache
> optimal behaviour, and the moderator is the fairness requirement, not the
> other way around.
>
> The classic example is two steady cpu loads and an occasionally waking
> client (like an editor)
>
> We end up scheduling [A, B are the loads, C is the editor)
>
> A C B C A C B C A C B C A
>
> whenever a key is hit we swap CPU hog because the priority balanced shifted.
> Really we should have scheduled something looking more like
>
> A C A C A C B C B C B C B
>
> I would argue there are two needed priorities
>
> 1. CPU usage based priority - the current one
>
> 2. Task priority.
>
> Task priority being set to maximum when a task sleeps and then bounded by
> a function of max(task_priorty, fn(cpupriority)) so that tasks fall down
> priority levels as their cpu usage in the set of time slices. This causes
> tasks that are CPU hogs to sit at the bottom of the pile with the same low
> task_priority meaning they run for long bursts and don't get pre-empted and
> switched with other hogs through each cycle of the scheduler.
Let me see if I have this right. Task priority goes to max on any (?)
sleep regardless of how long. And to min if it doesn't sleep for some
period of time. Where does the time slice counter come into this, if at
all?
For what its worth I am currently updating the MontaVista scheduler so,
I am open to ideas.
George
>
> This isnt idle speculation - I've done some minimal playing with this but
> my initial re-implementation didnt handle SMP at all and I am still not 100%
> sure how to resolve SMP or how SMP will improve out of the current cunning
> plan.
>
> Alan
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2001-10-05 17:49 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-04 21:04 Context switch times Mike Kravetz
2001-10-04 21:14 ` arjan
2001-10-04 21:25 ` David S. Miller
2001-10-04 21:39 ` Richard Gooch
2001-10-04 21:52 ` David S. Miller
2001-10-04 21:55 ` Benjamin LaHaise
2001-10-04 22:35 ` Davide Libenzi
2001-10-04 22:49 ` Mike Kravetz
2001-10-04 22:42 ` Linus Torvalds
2001-10-04 22:53 ` Benjamin LaHaise
2001-10-05 15:13 ` Alan Cox
2001-10-05 17:49 ` george anzinger [this message]
2001-10-05 22:29 ` Alan Cox
2001-10-05 22:56 ` Davide Libenzi
2001-10-05 23:04 ` Alan Cox
2001-10-05 23:16 ` Davide Libenzi
2001-10-05 23:17 ` Alan Cox
2001-10-05 23:21 ` Davide Libenzi
2001-10-05 23:43 ` Roger Larsson
2001-10-07 1:20 ` george anzinger
2001-10-07 1:33 ` Bill Davidsen
2001-10-07 9:56 ` Alan Cox
2001-10-06 2:24 ` Albert D. Cahalan
2001-10-06 2:57 ` Davide Libenzi
2001-10-07 9:57 ` Mika Liljeberg
2001-10-07 13:03 ` Ingo Oeser
2001-10-07 13:48 ` Mika Liljeberg
2001-10-07 14:24 ` Ingo Oeser
2001-10-07 14:33 ` Mika Liljeberg
2001-10-07 18:00 ` george anzinger
2001-10-07 22:06 ` Mika Liljeberg
2001-10-07 22:31 ` Davide Libenzi
2001-10-07 22:33 ` Mika Liljeberg
2001-10-07 23:49 ` george anzinger
2001-10-08 21:07 ` Mika Liljeberg
2001-10-08 22:54 ` discontig physical memory Petko Manolov
2001-10-08 23:05 ` David S. Miller
2001-10-08 23:18 ` Petko Manolov
2001-10-08 23:29 ` David S. Miller
2001-10-09 0:34 ` Petko Manolov
2001-10-09 0:36 ` Petko Manolov
2001-10-09 1:37 ` David S. Miller
2001-10-09 2:43 ` Petko Manolov
2001-10-08 15:19 ` Context switch times bill davidsen
2001-10-10 6:07 ` Mike Fedyk
2001-10-07 18:39 ` Davide Libenzi
2001-10-09 20:37 ` Hubertus Franke
2001-10-09 23:50 ` george anzinger
2001-10-11 10:52 ` Hubertus Franke
2001-10-04 23:41 ` Mike Kravetz
2001-10-04 23:50 ` Linus Torvalds
2001-10-05 15:15 ` Eric W. Biederman
2001-10-04 23:56 ` Davide Libenzi
2001-10-05 0:45 ` Andrea Arcangeli
2001-10-05 4:35 ` Mike Kravetz
2001-10-07 17:59 ` Andrea Arcangeli
2001-10-07 19:54 ` george anzinger
2001-10-07 20:24 ` Andrea Arcangeli
2001-10-09 4:55 ` Richard Gooch
2001-10-09 5:00 ` David S. Miller
2001-10-09 13:49 ` bill davidsen
-- strict thread matches above, loose matches on Subject: below --
2001-10-05 6:31 Michailidis, Dimitrios
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=3BBDF290.E3988F49@mvista.com \
--to=george@mvista.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=bcrl@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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