Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jan 2013 07:32:52 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        davidxu@freebsd.org
Cc:        arch@freebsd.org, Jilles Tjoelker <jilles@stack.nl>, toolchain@freebsd.org
Subject:   Re: Fast sigblock (AKA rtld speedup)
Message-ID:  <20130112053252.GI2561@kib.kiev.ua>
In-Reply-To: <50F0ADDA.4000801@gmail.com>
References:  <20130107182235.GA65279@kib.kiev.ua> <20130111095459.GZ2561@kib.kiev.ua> <50EFE830.3030500@freebsd.org> <20130111204938.GD2561@kib.kiev.ua> <20130111232906.GA29017@stack.nl> <50F0ADDA.4000801@gmail.com>

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

--O2lvLMQR9k8T/RyB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jan 12, 2013 at 08:27:06AM +0800, David Xu wrote:
> On 2013/01/12 07:29, Jilles Tjoelker wrote:
> > On Fri, Jan 11, 2013 at 10:49:38PM +0200, Konstantin Belousov wrote:
> >> http://people.freebsd.org/~kib/misc/rtld-sigblock.3.patch
> > The new fields td_sigblock_ptr and td_sigblock_val are in the part that
> > is zeroed for new threads, while the code in rtld appears to expect them
> > to be copied (on fork, vfork and pthread_create). The fields are
> > correctly zeroed on exec.
> >
> > Sharing the magic variable between threads means that one thread holding
> > an rtld lock will block signals for all other threads as well. This is
> > different from how the normal signal mask works but I don't know whether
> > it may break things. However, the patch depends on it in some way
> > because sigtd() does not know about fast sigblock and will therefore
> > happily select a thread that is fast-sigblocking to handle a signal
> > directed at the process.
> >
> > Although libthr's postpone approach is somewhat ugly, it does not depend
> > on any non-standard kernel features and does not delay the default
> > action. Would it be possible to move that code to libc to make things
> > easier for rtld? It looks like this requires teaching libc about various
> > threading concepts, though.
> Long time ago, if i remembered correctly, kib said that he wanted to
> merge libthr code into libc, I don't know its state.
Yes, this is correct, and I still want this.

>=20
> > Something feels ugly about not allowing applications to use this,
> > although I don't know how it would work. On the other hand, the strange
> > signal state created by this and implicit assumptions that the duration
> > will be short may be a reason to restrict its use to a relatively small
> > piece of code.
> >
> True, it seems it is for short duration.

--O2lvLMQR9k8T/RyB
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iQIcBAEBAgAGBQJQ8PWDAAoJEJDCuSvBvK1BDgUP/iWJXQukG9XrXeguc+y+bAOf
VcWtQfyWdFz0ZsOLdKH6z/gnRF/yiQynvp+na+rtq0rgWDBXIQ7uP0ZKItAevfkW
nFM7s12Gv1bQNQq59uFeyshU97ORHCk11ZpjLs84mcKPDWEyAsZQAxRXhz5oTSSL
SAkV3ooYeE6eSuFA6ZQgUT3WKDbTwpTTm1mTjGjnPWrRYNrKkrNNZ2P6E7uANawi
GWMX0sMbrhtrrmrwUPNdR7ny8jqcaQrCvLxZ+73cVEQBIZIhEuHt9QxqEwZm+OYX
v9xV4cSZfCLC2HA/zVxzch5HL+ZExBKDVkSx0K394giPzjlymJePq18VgiBTcozj
6tRPNaWNzUZj9ACwbXsr9sGPuv+/e3VqAR0b5nREOatqy2ha04Q80PZpyIf9Umwx
7D8qsRxmhQJhWfvPevaOeD22OuCy2Wv9qQ76p6OnprsNt8VMStMnBKoxpBL024Na
6VsUaK3QpI3zI1NLdzQyvbfXDd8pQBjYm6NC2Jv3ukX7uc1D3JXJtOESr1TnWyWe
QwT8Nf1hLM24mtqJQRipYE4wYSEYXNK3A5v1eXCF3PG/VipQ/I4j+3WPOmDdS6xu
E7y5hTNBlQvZuZIFb2FVcuvTuu3AgOB9hdmheZA/xJzsiHUy6dEYWrHST3FUhxHr
d7lyOHIZ890gPcsouqy7
=YOKS
-----END PGP SIGNATURE-----

--O2lvLMQR9k8T/RyB--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130112053252.GI2561>