From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by sourceware.org (Postfix) with ESMTPS id F0E4D3858D28 for ; Wed, 18 Jan 2023 17:53:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F0E4D3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-15b9c93848dso28037557fac.1 for ; Wed, 18 Jan 2023 09:53:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:references:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=kwqmUKw3SZWkO1Wc/cGt7klSAUFIu8YJLjkX+3lW8Io=; b=y9Xdu/kb3O5iQXlilQ1LfqNstIl2sLUuOuLcJ0zVIvQwmCulgxE9AhUeWApFXRvYAb kvwAlhFDWTA3J1WnQf84FNcfWkUnIKDmZIb1zZD5zq7tkLetnm6dA+Ofh+YBRJPkUQQi FUiKg9ZLbMZkJDj7cEp+oW4jSSQvva5FvZ5io4ao9pCSRiDrA28phqbO/0A5o5m7gmYB Rh4WbKfFBSEcu94epAaYKUIIJ6f+cDDus+YP9Wd1IppR0KbKv+wFEVF+EBRVhNIIBVza ztdyNoCL35kP+ZMRM272VwL4oPnxZ91vOGm07sS3A++10sswaMqiG9liOZNAGPiPT+WS Vwgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:references:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kwqmUKw3SZWkO1Wc/cGt7klSAUFIu8YJLjkX+3lW8Io=; b=V7Z8xu/dr/nUYpkd7EPoy3ilxG0MsIxB6b7s2QviNpBixxr3r3IZ+L2gl6pzE7z1/y jo1uLCN7CUKiF1RMUZNveP7OFD2qxg+iL3HEjH7ypUw+HO1zhErSHXxuYI6ORUhXW5m9 v41k1pE8hXcGZ3rQPH58PuQeOlvl9+YaecvsjKpW7CevB35zJy5Zn007jP/AX/n6ttP1 HldIlQR8VxzUoxl9iykIlha49rVb5qGfr+pPO21GoZuaWtxTbql6ea+rQ6tDF0yOVEut OF5LCIhKKbmAqTpNxcNgQP9TbBvfDdPlEMINub+x5ieyetcaNB9e+AyJB4u13Pib8Fr6 owAg== X-Gm-Message-State: AFqh2kojQkOraGviYKBx2mo4YC81b0cplpdOQ4L5xnprJGrDCeqwVvtQ UvS1XW54pZnuT6MigR013VDwecMsDLn8kRMy5JU= X-Google-Smtp-Source: AMrXdXtCOTHAG1HdEgEYNcalxVp+NeaAB6knrEW8+k27aBwE7w0lPT/XQiOeNGuGzRjkiNatub5ucw== X-Received: by 2002:a05:6870:d90c:b0:15f:e93:e158 with SMTP id gq12-20020a056870d90c00b0015f0e93e158mr4623564oab.3.1674064425661; Wed, 18 Jan 2023 09:53:45 -0800 (PST) Received: from ?IPV6:2804:18:874:c2db:1175:77b4:1b11:1d69? ([2804:18:874:c2db:1175:77b4:1b11:1d69]) by smtp.gmail.com with ESMTPSA id e8-20020a544f08000000b0035aa617156bsm16780341oiy.17.2023.01.18.09.53.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jan 2023 09:53:44 -0800 (PST) Message-ID: <97a93db6-8ade-14b6-64c7-8b81b2c6d3cb@linaro.org> Date: Wed, 18 Jan 2023 14:53:42 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v4 0/6] Optimize posix_spawn signal setup with clone3 Content-Language: en-US From: Adhemerval Zanella Netto To: libc-alpha@sourceware.org, Carlos O'Donell References: <20230112135853.3786675-1-adhemerval.zanella@linaro.org> Organization: Linaro In-Reply-To: <20230112135853.3786675-1-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Carlos, do we still want this for 2.37? On 12/01/23 10:58, Adhemerval Zanella wrote: > Currently posix_spawn has to issue at least NSIG sigaction syscalls > to obtain current signal disposition and more if they there are not > either SIG_IGN or SIG_DFL. The new clone3 CLONE_CLEAR_SIGHAND flags > introduced with Linux 5.5 resets all signal handlers of the child not > set to SIG_IGN to SIG_DFL, thus allowing posix_spawn to skip this > preparation phase. > > The exception is the signals defined by posix_spawnattr_setsigdefault > when POSIX_SPAWN_SETSIGDEF is set (since they can be SIG_IGN). In > this case posix_spawn helper process needs to issue a sigction to > set the signal disposition to SIG_DFL. > > The patchset also adds clone3 implementation for aarch64. The clone3 > for x86_64 is change to not align the stack, since this is not > async-signal safe (although current calls does mask/unmask signals). > > * Changes from v3: > - Changes commit message and comments wording. > - Removed powerpc, s390x, riscv, arm, and mips clone3 optimizations. > > * Changes from v2: > - Improve clone3 internal documentation. > > * Changes from v1: > - Extend clone3 documentation. > - Remove x86_64 stack alignment on clone3 child. > - Fixed powerpc64 missing initial stack frame. > - Fixed missing save/restore r7 for arm. > > Adhemerval Zanella (6): > linux: Do not reset signal handler in posix_spawn if it is already > SIG_DFL > linux: Extend internal clone3 documentation > Linux: Do not align the stack for __clone3 > linux: Add clone3 CLONE_CLEAR_SIGHAND optimization to posix_spawn > aarch64: Add the clone3 wrapper > Linux: optimize clone3 internal usage > > include/clone_internal.h | 37 +++- > posix/Makefile | 3 +- > posix/tst-spawn7.c | 179 ++++++++++++++++++ > sysdeps/unix/sysv/linux/Makefile | 3 +- > sysdeps/unix/sysv/linux/aarch64/clone3.S | 85 +++++++++ > sysdeps/unix/sysv/linux/aarch64/sysdep.h | 2 + > sysdeps/unix/sysv/linux/clone-internal.c | 59 ++++-- > sysdeps/unix/sysv/linux/clone3.h | 15 +- > sysdeps/unix/sysv/linux/kernel-features.h | 9 + > sysdeps/unix/sysv/linux/spawni.c | 33 +++- > .../sysv/linux/tst-misalign-clone-internal.c | 74 -------- > sysdeps/unix/sysv/linux/x86_64/clone3.S | 3 - > 12 files changed, 384 insertions(+), 118 deletions(-) > create mode 100644 posix/tst-spawn7.c > create mode 100644 sysdeps/unix/sysv/linux/aarch64/clone3.S > delete mode 100644 sysdeps/unix/sysv/linux/tst-misalign-clone-internal.c >