From: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: John Richard Moser <nigelenki@comcast.net>,
Chris Friesen <cfriesen@nortel.com>,
linux-kernel@vger.kernel.org
Subject: Re: Can context switches be faster?
Date: Sat, 14 Oct 2006 01:32:38 +0200 [thread overview]
Message-ID: <20061013233238.GA6038@rhlx01.fht-esslingen.de> (raw)
In-Reply-To: <452EA700.9060009@goop.org>
On Thu, Oct 12, 2006 at 01:35:12PM -0700, Jeremy Fitzhardinge wrote:
> John Richard Moser wrote:
> >That's a load more descriptive :D
> >
> >0.890 uS, 0.556uS/cycle, that's barely 2 cycles you know. (Pentium M)
> >PPC performs similarly, 1 cycle should be about 1uS.
> >
>
> No, you're a factor of 1000 off - these numbers show the context switch
> is around 1600-75000 cycles. And that doesn't really tell the whole
> story: if caches/TLB get flushed on context switch, then the newly
> switched-to task will bear the cost of having cold caches, which isn't
> visible in the raw context switch time.
>
> But modern x86 processors have a very quick context switch time, and I
> don't think there's much room for improvement aside from
> micro-optimisations (though that might change if the architecture grows
> a way to avoid flushing the TLB on switch).
OK, so since we've now amply worked out in this thread that TLB/cache flushing
is a real problem for context switching management, would it be possible to
smartly reorder processes on the runqueue (probably works best with many active
processes with the same/similar priority on the runqueue!) to minimize
TLB flushing needs due to less mm context differences of adjacently scheduled
processes?
(i.e. don't immediately switch from user process 1 to user process 2 and
back to 1 again, but always try to sort some kernel threads in between
to avoid excessive TLB flushing)
See also my new posting about this at
http://bhhdoa.org.au/pipermail/ck/2006-October/006442.html
Andreas Mohr
next prev parent reply other threads:[~2006-10-13 23:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 15:44 John Richard Moser
2006-10-12 15:53 ` John Richard Moser
2006-10-12 17:19 ` Russell King
2006-10-12 18:25 ` John Richard Moser
2006-10-12 18:37 ` Arjan van de Ven
2006-10-12 18:56 ` John Richard Moser
2006-10-12 19:02 ` Arjan van de Ven
2006-10-13 11:05 ` James Courtier-Dutton
2006-10-13 14:51 ` Chase Venters
2006-10-12 18:20 ` Phillip Susi
2006-10-12 18:29 ` John Richard Moser
2006-10-13 2:53 ` Andrew James Wade
2006-10-13 5:29 ` John Richard Moser
2006-10-13 16:56 ` Andrew James Wade
2006-10-13 17:24 ` John Richard Moser
2006-10-12 19:57 ` Chris Friesen
2006-10-12 20:23 ` John Richard Moser
2006-10-12 20:29 ` Arjan van de Ven
2006-10-12 20:36 ` John Richard Moser
2006-10-12 20:35 ` Jeremy Fitzhardinge
2006-10-13 23:32 ` Andreas Mohr [this message]
2006-10-13 23:47 ` David Lang
2006-10-14 0:14 ` Jeremy Fitzhardinge
2006-10-14 0:30 ` Alan Cox
2006-10-14 0:14 ` Jeremy Fitzhardinge
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=20061013233238.GA6038@rhlx01.fht-esslingen.de \
--to=andi@rhlx01.fht-esslingen.de \
--cc=cfriesen@nortel.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nigelenki@comcast.net \
/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
all inboxes | Powered by JetHome®