Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 May 2005 00:16:56 -0400
From:      Suleiman Souhlal <ssouhlal@FreeBSD.org>
To:        Daniel Eischen <deischen@FreeBSD.org>
Cc:        freebsd-stable <freebsd-stable@FreeBSD.org>
Subject:   Re: Performance issue
Message-ID:  <361776BC-F969-4F88-8656-E75A5D967186@FreeBSD.org>
In-Reply-To: <Pine.GSO.4.43.0505091907060.27904-100000@sea.ntplx.net>
References:  <Pine.GSO.4.43.0505091907060.27904-100000@sea.ntplx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello,

On May 9, 2005, at 7:21 PM, Daniel Eischen wrote:

> I don't think that patch is correct.  You need the signal mask
> in the kernel to match in case of an exec() after a fork()
> for instance.  If the application fork()'s, then changes the
> signal mask in the child (which is now single threaded), then
> the child exec()s, the mask is wrong.
>
> If the process wasn't linked to libpthread, then the longjmp()
> and setjmp() would still be calling the syscall, so it isn't
> the syscall itself that is making things slower.  You'll notice
> that there are two calls to __sys_sigprocmask() in the section
> of code you have patched.  You could eliminate the second call
> if you do some of what the remainder of the function does instead
> of returning early (the locks aren't needed and pending signals
> don't need to be run down).

Processes linked with libc_r NEVER call the syscall, once they have  
started (after rtld-elf):

zZzZ:~/py% LD_LIBMAP="libpthread.so.1=libc_r.so.5" ktrace -t c python  
heapsort.py 10000 > /dev/null && kdump -T | grep sigprocmask
   2991 python   1115698354.240301 CALL  sigprocmask 
(0x1,0x2810a820,0xbfbfea60)
   2991 python   1115698354.240304 RET   sigprocmask 0
   2991 python   1115698354.240307 CALL  sigprocmask(0x3,0x2810a830,0)
   2991 python   1115698354.240308 RET   sigprocmask 0
zZzZ:~/py%

compare with libpthread:
zZzZ:~/py% ktrace -t c python heapsort.py 10000 > /dev/null && kdump - 
T | grep -c sigprocmask
92114
zZzZ:~/py%

Is this a bug in libc_r?

--
Suleiman Souhlal     | ssouhlal@vt.edu
The FreeBSD Project  | ssouhlal@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?361776BC-F969-4F88-8656-E75A5D967186>