From mboxrd@z Thu Jan 1 00:00:00 1970 From: mulyadi.santosa@gmail.com (Mulyadi Santosa) Date: Sat, 26 Feb 2011 11:31:08 +0700 Subject: syscalls performance In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi Enrico... On Sat, Feb 26, 2011 at 03:42, Enrico Granata wrote: > > > I modified the source code to show exactly how many clock ticks it is taking > for each call. It seems that the behavior hinted by Mauro Romano Trajber is > actually there: > [enrico at espresso ~]$ ./syscallperf 15 > 4925 > 1190 > 942 watching strace, objdump etc etc, I roughly conclude the high initial tsc number might be due to initial symbol resolve to mygetpid() and/or syscall() (IIRC this is called PLT/GOT symbol resolve). After the GOT/PLT table had the syscall/mygetpid address, the rest went fast. PS: if using gcc -O2, seems like mygetpid() is really inlined.... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com