Skip to contentSkip to conversation

Confused about fsystemcalls

Linux-ia64 David Mosberger 2 participants 3 messages Jan 30, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Peter Chubb

Peter> The mygetpid() call appears to return the correct value.

Peter> Our figures show over an average of ten runs: --- glibc Peter> getpid() takes 579 cycles, stddev 24 --- mygetpid takes 1468 Peter> cycles, stddev 286

Have you tried on a McKinley? The numbers you quote for the standard getpid() look like for Merced. I never tried on Merced, though I don't know of why it shouldn't work fast, off hand.

Peter> I was also a little confused about the entry put into the ELF Peter> AUX vector -- was the value or the user-space address of Peter> syscall_via_epc meant to go into the vector? Currently it Peter> says in include/asm-ia64/elf.h

Oh, it was broken. I just fixed it today (since I got glibc to work with the new syscall stub) and it's in the lia64 bk tree now.

	--david
#1 lore raw
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

"David" = David Mosberger <[email protected]> writes:

On Thu, 30 Jan 2003 11:07:51 +1100, Peter Chubb <[email protected]> said:

Peter> The mygetpid() call appears to return the correct value.

Peter> Our figures show over an average of ten runs: --- glibc Peter> getpid() takes 579 cycles, stddev 24 --- mygetpid takes 1468 Peter> cycles, stddev 286

David> Have you tried on a McKinley? The numbers you quote for the David> standard getpid() look like for Merced. I never tried on David> Merced, though I don't know of why it shouldn't work fast, off David> hand.

Worked it out -- one needs to call the mygetpid() function twice, once before the timing stuff, and once during, so we don't count the time to get the gate page into the TLB and into the cache.

Timings are now 177 cycles for the mygetpid() routine as opposed to 570 for glibc (all on Itanium 1), and we're now working on gettimeofday().

Peter C

#2 lore raw
In reply to David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Peter Chubb

Peter> Worked it out -- one needs to call the mygetpid() function Peter> twice, once before the timing stuff, and once during, so we Peter> don't count the time to get the gate page into the TLB and Peter> into the cache.

Yes, that makes a big difference. Here is what I see for getppid() on a McKinley:

	getppid cycles: 1410 79 56 54 54 54 54 54 54 54

(I just added getppid() and I also added code to patch over the McKinley E9 workaround on CPUs that don't need it.)

Peter> Timings are now 177 cycles for the mygetpid() routine as Peter> opposed to 570 for glibc (all on Itanium 1),

Ah, that's much better.

Peter> and we're now working on gettimeofday().

Cool. I assume you're doing this based on the lock-free version that Andrew Morton has in his latest patch?

	--david