From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id 2985A3865C1F for ; Thu, 27 Oct 2022 16:48:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2985A3865C1F 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-oi1-x22e.google.com with SMTP id r83so2871298oih.2 for ; Thu, 27 Oct 2022 09:48:39 -0700 (PDT) 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=hrh4MOEajkP/uixgC6rgURmFKqQsgJOoJ68He40lEaA=; b=kJZeNT7nH3gPLoPOKEByCOPBVZmAbZN9D/XxqhOBze/QJKpB9jerCLeZBD0/IUi54+ JXTIFkchjZVSPcNW68YQBXeacSthFl2fSH+Mc+Ukccr5JI0OdUgMNhi8ekwT5BtVlPl9 lRMneA0y/x0ZKl7XSZyVy5tSGjDbGEbcutfLv+dlq76aQkXSy3IGEX52bVCxU5QLWdI2 6i6ZDRTZWOxRItWGvRrKJtK7SKIaekFAOVvavjK/DlEeD7jyAap0bTltvTqriyDBVPmK ZzqHNSImTaLUKELV8xuN2xBPwQ1kLae4VNuK8IXXjw+ROOyvlumIAYIRtAPIEgWPZ6A1 px2w== 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=hrh4MOEajkP/uixgC6rgURmFKqQsgJOoJ68He40lEaA=; b=eYrqEfzmPOIOLNG4ikLHDQ6rhqBdFQzLDhh/AR6aqWb8vD2UFLbZQxcpDloFuU0dVA 7r+Kl5PfP0HiWSWLezKR+Nx/ZQhdycBJsdDND8J1egrGPAX0JhRdnL1of64weNvYwWUd gl482xahgx7m8owWXS9aCSiIBpEpIiXjZI6H4BE/p4kfzOrR8LFci0SwPyE+6h71KUAD a8qIG/K01k/u7OjH81OMj+z43Av461p4GSpWC1iYqtkb+5ND7Nmles08WNRfzq3aQ1mF xtqUVRFb498tgl/QCFAD3ij93Uh1INwfxQjoM3l7dL2R5YCkEZUNX/KArSVhfUorNDAH CT9A== X-Gm-Message-State: ACrzQf3BtuQlbF+Hfa2N+tKAKsifNWoRzRwOJdJGHE5NGd8Jz9FvLpaN MCThEDIUKaU6v6grijZuCOysb+7nV4SzAx5S X-Google-Smtp-Source: AMsMyM6TlzrWxm08fJJyd3uqSlRkrVoAiNW/G4JjDdammDIlJ/Rct1yIjj6jhcbSLUAkMQa2iR52dg== X-Received: by 2002:a05:6808:1446:b0:354:fc18:5ae3 with SMTP id x6-20020a056808144600b00354fc185ae3mr5542182oiv.281.1666889318304; Thu, 27 Oct 2022 09:48:38 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:17c8:b401:dc33:5f67:ef17? ([2804:1b3:a7c0:17c8:b401:dc33:5f67:ef17]) by smtp.gmail.com with ESMTPSA id t22-20020a9d7756000000b00661ac688285sm684778otl.0.2022.10.27.09.48.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Oct 2022 09:48:37 -0700 (PDT) Message-ID: <8f041569-88f1-b223-744d-88ea548a51b5@linaro.org> Date: Thu, 27 Oct 2022 13:48:35 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v2 0/9] Optimize posix_spawn signal setup with clone3 Content-Language: en-US From: Adhemerval Zanella Netto To: libc-alpha@sourceware.org, Christian Brauner References: <20220930192613.3491147-1-adhemerval.zanella@linaro.org> Organization: Linaro In-Reply-To: <20220930192613.3491147-1-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.7 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: Ping. On 30/09/22 16:26, 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, powerpc64, > s390x, riscv, arm, and mips. > > Changes from v1: > * Adeed arm and mips clone3 implementation. > > Adhemerval Zanella (9): > linux: Do not reset signal handler in posix_spawn if it is already > SIG_DFL > linux: Add clone3 CLONE_CLEAR_SIGHAND optimization to posix_spawn > powerpc64le: Add the clone3 wrapper > aarch64: Add the clone3 wrapper > s390x: Add the clone3 wrapper > riscv: Add the clone3 wrapper > arm: Add the clone3 wrapper > mips: Add the clone3 wrapper > Linux: optimize clone3 internal usage > > include/clone_internal.h | 10 + > posix/Makefile | 3 +- > posix/tst-spawn7.c | 179 ++++++++++++++++++ > sysdeps/unix/sysv/linux/aarch64/clone3.S | 90 +++++++++ > sysdeps/unix/sysv/linux/aarch64/sysdep.h | 2 + > sysdeps/unix/sysv/linux/arm/clone3.S | 80 ++++++++ > sysdeps/unix/sysv/linux/arm/sysdep.h | 1 + > sysdeps/unix/sysv/linux/clone-internal.c | 59 ++++-- > sysdeps/unix/sysv/linux/clone3.h | 6 + > sysdeps/unix/sysv/linux/kernel-features.h | 9 + > sysdeps/unix/sysv/linux/mips/clone3.S | 147 ++++++++++++++ > sysdeps/unix/sysv/linux/mips/sysdep.h | 2 + > .../sysv/linux/powerpc/powerpc64/clone3.S | 145 ++++++++++++++ > sysdeps/unix/sysv/linux/powerpc/sysdep.h | 1 + > sysdeps/unix/sysv/linux/riscv/clone3.S | 83 ++++++++ > sysdeps/unix/sysv/linux/riscv/sysdep.h | 1 + > sysdeps/unix/sysv/linux/s390/s390-64/clone3.S | 84 ++++++++ > sysdeps/unix/sysv/linux/s390/sysdep.h | 1 + > sysdeps/unix/sysv/linux/spawni.c | 33 +++- > 19 files changed, 910 insertions(+), 26 deletions(-) > create mode 100644 posix/tst-spawn7.c > create mode 100644 sysdeps/unix/sysv/linux/aarch64/clone3.S > create mode 100644 sysdeps/unix/sysv/linux/arm/clone3.S > create mode 100644 sysdeps/unix/sysv/linux/mips/clone3.S > create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/clone3.S > create mode 100644 sysdeps/unix/sysv/linux/riscv/clone3.S > create mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/clone3.S >