From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1F2081F47C for ; Wed, 11 Jan 2023 21:24:54 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=InffdpKx; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F283385828D for ; Wed, 11 Jan 2023 21:24:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F283385828D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673472293; bh=8A9/2oTbzngc+fJ5zJbpQwNzBNEV/9dWvtWp6pKLf8I=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=InffdpKxAI9F1Dgx0BZaKrV/zl/nVqN7NnP6jR/UZMC2jTU4rhSzfNIr1vXK1Gjum po1KO9+WUE40vTkC/mDs2LZiBPJlpTxDo420NyUu896Ey6dnueo8ZTj/r+InBESaHY DB+qYwkIqd+Qty3j+K2e7BYfphlWytOBvqy4jsiE= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 92A053858C83 for ; Wed, 11 Jan 2023 21:24:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 92A053858C83 Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-223-VwYEi9vRP5qXMGJ-hX-jAQ-1; Wed, 11 Jan 2023 16:24:18 -0500 X-MC-Unique: VwYEi9vRP5qXMGJ-hX-jAQ-1 Received: by mail-io1-f72.google.com with SMTP id o16-20020a056602225000b006e032e361ccso9906327ioo.13 for ; Wed, 11 Jan 2023 13:24:17 -0800 (PST) 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:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8A9/2oTbzngc+fJ5zJbpQwNzBNEV/9dWvtWp6pKLf8I=; b=wEkrssvrOUZN56Hnn8WeYK3qbRaA6fpwWKEZxCNMcBTLmA3JlSFCxrEhvbtLBPiIR+ Hwr8mY2pCAqzQMbgEtyIRTfmN+9jmZR7l/3pvDg3lJdSqgQ6T6EK8MIV4qrN0vFbH8fa xDIKNSAE7L1uqq5ntZ0q+4kiX1/uwSumSOXZlGv8AN9neY1ZZyYIERFD6G1KnmQMtWxF Pji67jxw4IbFSW7MJTJUPbJnQ+ykzWAfsU0Sk/RmZylrIuMfXjp7XK1qht6kTS3Kd/6g wiMxPyBGMXe0r92P8mACx6ISDeSiQn8XVQ0yyqHLeBQsTnoEWuSDjug9X8b1oYR+HN0K 1C1w== X-Gm-Message-State: AFqh2kpDmDGLN+r6peH7Pfg5MnjQ2A1I54+c+PBd6Cnw0K6a/saCjNR7 wQ9oxWwyMX7UTwiKht4Ys6wDC/WNo1KHev1uXRsI2VV7tAlHTBbLOG+drsnSLhTapxfHmzV2zrz BKrtK3PJp1Z8BsjFbosBx X-Received: by 2002:a6b:ee18:0:b0:6e0:97:2154 with SMTP id i24-20020a6bee18000000b006e000972154mr47984545ioh.5.1673472257309; Wed, 11 Jan 2023 13:24:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXsFxRprnRvp+oIpaTsm0/2KPzl4GZGUlf9UkHn7SreGcD8JcYhb/JlqLRmxWWhrQSO5E17WVA== X-Received: by 2002:a6b:ee18:0:b0:6e0:97:2154 with SMTP id i24-20020a6bee18000000b006e000972154mr47984539ioh.5.1673472257045; Wed, 11 Jan 2023 13:24:17 -0800 (PST) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id j2-20020a056e02014200b00305ef09a3easm4769518ilr.37.2023.01.11.13.24.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jan 2023 13:24:16 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2023 16:24:15 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v2 00/11] Optimize posix_spawn signal setup with clone3 To: Adhemerval Zanella , libc-alpha@sourceware.org, Szabolcs Nagy , "H . J . Lu" Cc: Christian Brauner References: <20221104190112.2566409-1-adhemerval.zanella@linaro.org> Organization: Red Hat In-Reply-To: <20221104190112.2566409-1-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Carlos O'Donell via Libc-alpha Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 11/4/22 15:01, Adhemerval Zanella via Libc-alpha 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. 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). Same comments here that apply for the original v2. This is actually v3. Please post v4 with changes and limit it to x86_64 and aarch64. If arch maintainers respond with a Reviewed-by: then we can include it into the release. I don't want to make assembly changes this close to the release. > * 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 (11): > 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 > powerpc64: 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 | 39 +++- > 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/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 | 15 +- > sysdeps/unix/sysv/linux/kernel-features.h | 9 + > sysdeps/unix/sysv/linux/mips/clone3.S | 139 ++++++++++++++ > sysdeps/unix/sysv/linux/mips/sysdep.h | 2 + > .../sysv/linux/powerpc/powerpc64/clone3.S | 152 +++++++++++++++ > sysdeps/unix/sysv/linux/powerpc/sysdep.h | 1 + > sysdeps/unix/sysv/linux/riscv/clone3.S | 80 ++++++++ > sysdeps/unix/sysv/linux/riscv/sysdep.h | 1 + > sysdeps/unix/sysv/linux/s390/s390-64/clone3.S | 81 ++++++++ > sysdeps/unix/sysv/linux/s390/sysdep.h | 1 + > sysdeps/unix/sysv/linux/spawni.c | 33 +++- > .../sysv/linux/tst-misalign-clone-internal.c | 74 -------- > sysdeps/unix/sysv/linux/x86_64/clone3.S | 3 - > 22 files changed, 924 insertions(+), 118 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 > delete mode 100644 sysdeps/unix/sysv/linux/tst-misalign-clone-internal.c > -- Cheers, Carlos.