> > it seems that sigsetjmp() has
> > relatively large overhead, we could reduce some overhead by not
> > calling it.
>
> How do you measure it? I'm curious myself - I know there's the possibility to
> use gprof, but I've never used that myself.

i usually use pentium rdtsc(read time stamp counter) to measure the
timing and latency. (sometimes by instrumenting kernel or sometimes by
measuring test programs) i ran a test program and measured the
overhead of sigsetjmp() and setjmp(). it showed sigsetjmp() uses
around 1350 cycles (which is around 0.45 us in 3.0GHz machine), and
setjmp() only 21 cycles (< 0.01us). maybe while sigsetjmp() is
implemented as a system call to cope with signal blocking/unblocking,
setjmp() is not a system call? (getpid() itself takes more than 1000
cycles)

thanks,

>
> Surely the "sig" thing is heavy (some syscalls like sigprocmask() for
> blocking/unblocking signals). Or better, it's the only heavy thing - the rest
> consists only of saving a couple of registers (6, IIRC) in memory, there's no
> interest in optimizing it away (I assume).
>


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to