From: Eric Dumazet <dada1@cosmosbay.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andi Kleen <ak@suse.de>, Ingo Molnar <mingo@elte.hu>,
akpm@osdl.org, Arjan van de Ven <arjan@infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i386-pda UP optimization
Date: Tue, 21 Nov 2006 22:58:06 +0100 [thread overview]
Message-ID: <4563766E.8070408@cosmosbay.com> (raw)
In-Reply-To: <456372AD.5080807@goop.org>
Jeremy Fitzhardinge a écrit :
> Eric Dumazet wrote:
>> I did *lot* of reboots of my Dell D610 machine, with some trivial benchmarks
>> using : pipe/write()/read, umask(), or getppid(), using or not oprofile.
>>
>> I managed to avoid reloading %gs in sysenter_entry .
>> (avoiding the two instructions : movl $(__KERNEL_PDA), %edx; movl %edx, %gs
>>
>> I could not avoid reloading %gs in system_call, I dont know why, but modern
>> glibc use sysenter so I dont care :)
>>
>> I confirm I got better results with my patched kernel in all tests I've done.
>>
>> umask : 12.64 s instead of 12.90 s
>> getppid : 13.37 s instead of 13.72 s
>> pipe/read/write : 9.10 s instead of 9.52 s
>>
>> (I got very different results in umask() bench, patching it not to use xchg(),
>> since this instruction is expensive on x86 and really change oprofile
>> results. I will submit a patch for this.
>>
>
> Could you go into more detail about what you're actually measuring
> here? Is it 10,000,000 loops of the single syscall? pipe/read/write
> suggests that you're doing at least 2 syscalls per loop, but it takes
> the smallest elapsed time.
for umask/getppid(), its a basic loop with 100.000.000 iterations
for read/write(), loop with 10.000.000 iterations
>
> What are you using as your time reference? Real time? Process time?
>
elapsed time (/usr/bin/time ./prog)
10 runs, and the minimum time is taken.
> For umask/getppid, assuming you're just running 1e7 iterations, you're
> seeing a difference of 25 and 35ns per iteration difference. I wonder
> why it would be different for different syscalls; I would expect it to
> be a constant overhead either way. Certainly these numbers are much
> larger than I saw when I benchmarked pda-vs-nopda using lmbench's null
> syscall (getppid) test; I saw an overall 9ns difference in null syscall
> time on my Core Duo run at 1GHz. What's your CPU and speed?
Its a 1.6GHz Pentium-M CPU (Dell D610)
>
> One possibility is a cache miss on the gdt while reloading %gs. I've
> been planning on a patch to rearrange the gdt in order to pack all the
> commonly used segment descriptors into one or two cache lines so that
> all the segment register reloads can be done with a minimum of cache
> misses. It would be interesting for you to replace the:
>
> movl $(__KERNEL_PDA), %edx; movl %edx, %gs
>
> with an appropriate read of the gdt entry, hm, which is a bit complex to
> find.
>
Hum... Do you mean a cache miss every time we do a syscall ? What could
invalidate this cache exactly ?
next prev parent reply other threads:[~2006-11-22 1:37 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-12 7:35 i386 PDA patches use of %gs Arjan van de Ven
2006-09-12 7:48 ` Jeremy Fitzhardinge
2006-09-12 7:56 ` Arjan van de Ven
2006-09-12 8:31 ` Jeremy Fitzhardinge
2006-11-15 11:27 ` [PATCH] i386-pda UP optimization Eric Dumazet
2006-11-15 11:32 ` Andi Kleen
2006-11-15 17:20 ` Ingo Molnar
2006-11-15 17:24 ` Andi Kleen
2006-11-15 17:46 ` Eric Dumazet
2006-11-15 17:49 ` Ingo Molnar
2006-11-15 17:58 ` Eric Dumazet
2006-11-15 18:01 ` Ingo Molnar
2006-11-21 11:38 ` Eric Dumazet
2006-11-21 21:42 ` Jeremy Fitzhardinge
2006-11-21 21:52 ` Andi Kleen
2006-11-21 22:10 ` Jeremy Fitzhardinge
2006-11-21 21:58 ` Eric Dumazet [this message]
2006-11-21 23:12 ` Jeremy Fitzhardinge
2006-11-15 17:28 ` Jeremy Fitzhardinge
2006-11-15 17:32 ` Ingo Molnar
2006-11-15 17:59 ` Jeremy Fitzhardinge
2006-11-15 18:05 ` Eric Dumazet
2006-11-15 18:28 ` Jeremy Fitzhardinge
2006-11-15 18:31 ` Ingo Molnar
2006-11-15 18:01 ` Arjan van de Ven
2006-11-15 18:24 ` Jeremy Fitzhardinge
2006-11-15 19:06 ` Ingo Molnar
2006-11-17 0:24 ` Jeremy Fitzhardinge
2006-11-15 17:52 ` Jeremy Fitzhardinge
2006-11-28 23:12 ` Jeremy Fitzhardinge
2006-11-29 9:30 ` Eric Dumazet
2006-11-29 9:56 ` Jeremy Fitzhardinge
2006-09-13 1:00 ` i386 PDA patches use of %gs Jeremy Fitzhardinge
2006-09-13 9:59 ` Ingo Molnar
2006-09-13 16:17 ` Jeremy Fitzhardinge
2006-11-15 18:26 ` Ingo Molnar
2006-11-15 18:29 ` Ingo Molnar
2006-11-15 18:43 ` Jeremy Fitzhardinge
2006-11-15 18:44 ` Ingo Molnar
2006-11-15 18:39 ` Jeremy Fitzhardinge
2006-11-15 18:43 ` Ingo Molnar
2006-11-15 18:49 ` Jeremy Fitzhardinge
2006-11-15 18:49 ` Ingo Molnar
2006-11-15 19:00 ` Jeremy Fitzhardinge
2006-11-15 19:03 ` Ingo Molnar
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=4563766E.8070408@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
Powered by JetHome