Re: i386 PDA patches use of %gs

From: Ingo Molnar
Date: Wed Nov 15 2006 - 13:31:33 EST



* Ingo Molnar <mingo@xxxxxxx> wrote:

> > 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.

for example, your test_fs() code does:

for(i = 0; i < COUNT; i++) {
asm volatile("push %%fs; mov %1, %%fs; addl $1, %%fs:%0; popl %%fs"
: "+m" (*offset): "r" (seg) : "memory");
sync();
}

that loads (and uses) a single selector value for %fs, and doesnt do any
mixed use as far as i can see.

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/