This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 4/5] linux: Optimize posix_spawn spurious sigaction calls
- From: Christian Brauner <christian dot brauner at ubuntu dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Date: Mon, 7 Oct 2019 23:08:15 +0200
- Subject: Re: [PATCH 4/5] linux: Optimize posix_spawn spurious sigaction calls
- References: <20190731183136.21545-4-adhemerval.zanella@linaro.org> <875zmg9xjr.fsf@oldenburg2.str.redhat.com> <4266b563-5433-8bb9-78a2-af0ff14cab59@linaro.org> <87ftlj6k69.fsf@oldenburg2.str.redhat.com> <c38546d4-1349-edfc-1d74-33f024cdf8cb@linaro.org> <87v9uavnzs.fsf@oldenburg2.str.redhat.com> <95503672-bc82-c0bc-0a30-5724644b0037@linaro.org> <fb3cff3f-8b86-0a85-79ee-01eb312966fa@linaro.org> <20191007182526.qqmgziscbyxietve@wittgenstein> <87eezoflt7.fsf@oldenburg2.str.redhat.com>
On Mon, Oct 07, 2019 at 08:32:52PM +0200, Florian Weimer wrote:
> * Christian Brauner:
>
> >> >>>>> Maybe a CLONE_RESET_SIGNALS where the cloned process sets its signal
> >> >>>>> disposition to default SIG_IGN/SIG_DFL values may help us here. However
> >> >>>>> afaik clone now is out of space on 'flags' for newer ones (it already
> >> >>>>> defines 24 flags plus it reserve 8 bits for signal to be sent at process
> >> >>>>> exit) and it would take time to use this feature on glibc.
> >> >>>>
> >> >>>> Christian Brauner has been working on fixing this.
> >> >>>
> >> >>> Which strategy he is proposing? Even with proper kernel support, it would
> >> >>> take time to enable glibc to use it.
> >> >>
> >> >> Lots of flag arguments, with the reset of the arguments located
> >> >> indirectly via a pointer argument.
> >> >>
> >> >> For a pure optimization, I think it's not too bad to require kernel
> >> >> backports of system calls.
> >
> > So I just accidently caught wind of this discussion. :)
>
> Good. 8-)
>
> > I'm open to extending clone3() to support something like the above.
> > My new clone3() version has been released with Linux 5.3. It takes a
> > struct clone_args. The structure is versioned by size and thus - in
> > theory - extensible indefinitely.
>
> Christian, would you be able to implement the CLONE_RESET_SIGNALS flag
> for us? It should reset any handler which is not SIG_IGN or SIG_DFL to
> SIG_DFL. We'd also need a way to probe that the flag is supported, so
> that we can fall back to the current way of doing things otherwise.
Yeah, I can implement this. It shouldn't be too much work and if I can
Cc you and point out that you'd need/want this feature I can send a PR
for my thread updates for the 5.5 merge window.
Would that work for you?
Thanks!
Christian