From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A5CBC3858D28 for ; Wed, 18 Jan 2023 22:24:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5CBC3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674080663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vackAunoI3RUYFcCNRygJSf6hQK+27kJpGBajhN4zCg=; b=X0bG9wj5/K5eaU2lbOjS65v3VnnWYwEWa+FN7FBJiIcCoC9HQOmz7nSZZrPZ8yNugBuixX H/5GfXAkG4rwr2DF54/RDSJHHn/032tHNv4L0NuHubcUeCauzp0UYHk12cLo2QrZogJ7H1 a3CcrkySIvw/b+K3I7MYrVKkkNFrFn0= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-146-UL7eVMJ8Pde-r57pWEfnfQ-1; Wed, 18 Jan 2023 17:24:22 -0500 X-MC-Unique: UL7eVMJ8Pde-r57pWEfnfQ-1 Received: by mail-il1-f199.google.com with SMTP id q12-20020a056e0220ec00b0030f12525001so352867ilv.10 for ; Wed, 18 Jan 2023 14:24:21 -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 :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=vackAunoI3RUYFcCNRygJSf6hQK+27kJpGBajhN4zCg=; b=eJmRb1m+rOALNe+knZSIr0GDKafWiFrkGnBb+U+11TtoXeZv3qIsaewuVne1tD38pW 0VPauwbKmCSrWZWu+ekFrHMxU2qQTviesYcqbCRYuCVGpTTMnxDMtHf81/yfO27I8BrG BfiIySumNNt7xP/PYj32ridKkDnOsS1xOWU5xbCVKzQnmlhanv/znN5Y/n4gZUPbkCUV X651gnDgwOw4ltgQuDCgTsvQ+0OpXYJ4bqVbxIj+zjaZldRLv8UHAwOsefZGWfmmq1YN OY4YFcz1IiBp2kijpVOZOTSn5Ydg7wsRmNNV6iUG2pUO4Xn5vabomQJGV9WpRhAiqIEj AeAw== X-Gm-Message-State: AFqh2krBs3pIum0/NyTJPiiSKUWc5F1odGrlhmShVXqLJeKMIeRd4ad1 v78msD5DAXhtFFEshasfPrQXTVW/tXZ42Rcsibd6XxxofssjzMNtceqwvbowwgobIHt1PzZZQ7v 77ZeZC+4y/0iejBRPIo+2 X-Received: by 2002:a92:b05:0:b0:30e:e070:cae9 with SMTP id b5-20020a920b05000000b0030ee070cae9mr7084243ilf.28.1674080660789; Wed, 18 Jan 2023 14:24:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXu6gktREiaExJ9EABJRPIn9vw2wCXg1TnNasN5JzVU+mPaVMrt6Ut1+EOVoKWqIdA/GeDDkWw== X-Received: by 2002:a92:b05:0:b0:30e:e070:cae9 with SMTP id b5-20020a920b05000000b0030ee070cae9mr7084227ilf.28.1674080660507; Wed, 18 Jan 2023 14:24:20 -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 a11-20020a02734b000000b00388660ca27dsm10836801jae.4.2023.01.18.14.24.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jan 2023 14:24:20 -0800 (PST) Message-ID: Date: Wed, 18 Jan 2023 17:24:19 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v4 0/6] Optimize posix_spawn signal setup with clone3 To: Adhemerval Zanella Netto , libc-alpha@sourceware.org References: <20230112135853.3786675-1-adhemerval.zanella@linaro.org> <97a93db6-8ade-14b6-64c7-8b81b2c6d3cb@linaro.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <97a93db6-8ade-14b6-64c7-8b81b2c6d3cb@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-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: On 1/18/23 12:53, Adhemerval Zanella Netto wrote: > Carlos, do we still want this for 2.37? I think we should just push this to 2.38. Start by committing everything we have for x86_64 and aarch64. Then repost the other arches for review. > 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 >> > -- Cheers, Carlos.