lkml.org 
[lkml]   [2005]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: X86_64 Ctx switch times - 32bit vs 64bit
From
Date
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
-
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/

\
 
 \ /
  Last update: 2005-05-07 16:44    [W:0.055 / U:1.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site