public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: "Zack Weinberg" <zackw@panix.com>, "Robert Święcki" <robert@swiecki.net>
Cc: GLIBC Devel <libc-alpha@sourceware.org>
Subject: Re: Caching of PID/TID after fork
Date: Fri, 07 Oct 2016 18:30:00 -0000	[thread overview]
Message-ID: <6759a113-e871-b439-f165-2cb1b36cdfe2@linaro.org> (raw)
In-Reply-To: <CAKCAbMg+FzVQmSu2+yOZXngxb9z9hp6vHfKZJv_vwVs3UJMs_Q@mail.gmail.com>

On 06/10/2016 21:43, Zack Weinberg wrote:
> On Thu, Oct 6, 2016 at 8:42 PM, Zack Weinberg <zackw@panix.com> wrote:
>> On Thu, Oct 6, 2016 at 5:35 PM, Robert Święcki <robert@swiecki.net> wrote:
>>> Maybe providing something like fork_with_flags(int flags) would work
>>> here? Seems that most (all?) the projects that I've seen, which use
>>> clone() directly and had problems with caching of TID/PID, basically
>>> need fork with some flags (mainly of the CLONE_NEW* type). Such
>>> function would deal with tid/gid/locks/pthread_atfork as fork does,
>>> but would also OR the provided flags with the canonical ones?
>>
>> I've thought for quite some time that there should be a second
>> clone-wrapper in glibc that doesn't ask for a new stack.  It might be
>> better to call it something with "clone" in the name, but I don't care
>> terribly much.
> 
> Meant to say: in addition to the PID/TID caching issues, this would be
> able to run pthread_atfork() handlers.
> 
> zw

Adding a new implementation would require either change the clone
prototype (since flags is used for the kernel defined ones) or
adding a new arch-specific implementation.  This is an extra
burden on current assembly-only clone variants and for new
ports (an extra symbol to implement).

The stack check seems just error-prone one and I see it might be
justifiable to remove it.  I am not sure how we should act on 
semantic change for Linux-only syscall, so it might require to 
add compatibility symbol I would try to avoid it.  Also, this path
would lead to more arch-specific assembly hackery that I would
try to avoid.

  parent reply	other threads:[~2016-10-07 18:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06 16:13 Robert Święcki
2016-10-06 16:34 ` Paul Pluzhnikov
2016-10-06 17:03   ` Robert Święcki
2016-10-06 18:32     ` Adhemerval Zanella
2016-10-06 17:26 ` Rich Felker
2016-10-06 17:42   ` Robert Święcki
2016-10-06 18:05     ` Rich Felker
2016-10-06 18:26       ` Robert Święcki
2016-10-06 21:35         ` Robert Święcki
2016-10-07  0:42           ` Zack Weinberg
2016-10-07  0:43             ` Zack Weinberg
2016-10-07 14:44               ` Robert Święcki
2016-10-07 18:20                 ` Adhemerval Zanella
2016-10-07 18:30               ` Adhemerval Zanella [this message]
2016-10-07 19:38 ` Florian Weimer
2016-10-07 21:23   ` Robert Święcki
2016-10-09 10:05     ` Florian Weimer
2016-10-09 14:19       ` Robert Święcki
2016-10-10 18:03         ` Adhemerval Zanella
2016-11-04 15:14           ` Florian Weimer
2016-11-04 16:03             ` Adhemerval Zanella
2016-11-07 16:04               ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6759a113-e871-b439-f165-2cb1b36cdfe2@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=robert@swiecki.net \
    --cc=zackw@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).