lkml.org 
[lkml]   [2006]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: i386 PDA patches use of %gs

* Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Ingo Molnar wrote:
> >well, the most important thing i believe you didnt test: the effect of
> >mixing two descriptors on the _same_ selector: one %gs selector value
> >loaded and used by glibc, and another %gs selector value loaded and used
> >by the kernel, intermixed. It's the mixing that causes the descriptor
> >cache reload. (unless i missed some detail about your testcase)
>
> But it doesn't mix different descriptors on the same selector; the GDT
> is initialized when the CPU is brought up, and is unchanged from then
> on. The PDA descriptor is GDT entry 27 and the userspace TLS entries
> are 6-8, so in the typical case %gs will alternate between 0x33 and
> 0xd8 as it enters and leaves the kernel.
>
> My test program does the same thing, except using GDT entries 6 and 7
> (selectors 0x33 and 0x3b).

no, that's not what it does. It measures 50000000 switches of the _same_
selector value, without using any of the selectors in the loop itself.
I.e. no mixing at all! But when the kernel and userspace uses %gs, it's
the cost of switching between two selector values of %gs that has to be
measured. Your code does not measure that at all, AFAICS.

Ingo
-
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: 2006-11-15 19:29    [W:0.054 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site