public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Parag Warudkar <kernel-stuff@comcast.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: X86_64 Ctx switch times - 32bit vs 64bit
Date: Sat, 07 May 2005 16:40:07 +0200	[thread overview]
Message-ID: <m1mzr7w14o.fsf@muc.de> (raw)
In-Reply-To: <200505052138.57821.kernel-stuff@comcast.net> (Parag Warudkar's message of "Thu, 5 May 2005 21:38:57 -0400")

Parag Warudkar <kernel-stuff@comcast.net> writes:

> I was experimenting with the attached program (taken from an IBM 
> Developerworks article) to find the context switch times on AMD64 machine.
>
> With a 64bit binary I get average 5 to 8 usec/cswitch, whereas the same 
> program compiled as 32bit consistently gives >= 10 usec/cswitch - sometimes 
> even 13 usec/cswitch.
>
> Are there more context switching overheads when running 32bit programs on a 
> 64bit kernel?

Should be nearly the same in theory, no. This means 32bit programs use %gs
as thread register which is a bit more costly to switch because
the kernel uses it internally too, but the difference should be less
than that.

I suspect your program is more testing the locks anyways, perhaps
there is some other difference in the glibc. e.g. 32bit glibc compiled
for pre 686 CPUs has slower locks.

oprofile might provide more clue where the overhead is.

-Andi

  reply	other threads:[~2005-05-07 14:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06  1:38 X86_64 Ctx switch times - 32bit vs 64bit Parag Warudkar
2005-05-07 14:40 ` Andi Kleen [this message]
2005-05-10  1:31   ` Parag Warudkar
2005-05-10  1:48     ` Andi Kleen

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=m1mzr7w14o.fsf@muc.de \
    --to=ak@muc.de \
    --cc=kernel-stuff@comcast.net \
    --cc=linux-kernel@vger.kernel.org \
    /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