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.129.124]) by sourceware.org (Postfix) with ESMTPS id B414F3858D32 for ; Sun, 22 Jan 2023 23:21:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B414F3858D32 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=1674429717; 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=VpFtyoB94J/VrrJwBneCP1REtYsOhgVIUKnbLMjg17g=; b=BWI9tWgqyfzJgGr+TL5tvZVNeH3kY9BVzSrXDdg+rIjTxPIrlRB9/uF98tR43/hOyLEo3x stllo/lHl30i3rcyp9uP/vpPA6VkW8t4wS990H3/wqXJ+E1qUJJhbR/yQfEKNTKG1xDw55 /r58mOXForeitwfaqumv7+d88DbY9Ww= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-261-enT76CQDOhafvM9oHPlKAQ-1; Sun, 22 Jan 2023 18:21:56 -0500 X-MC-Unique: enT76CQDOhafvM9oHPlKAQ-1 Received: by mail-il1-f197.google.com with SMTP id r6-20020a92cd86000000b00304b2d1c2d7so7327364ilb.11 for ; Sun, 22 Jan 2023 15:21:55 -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=VpFtyoB94J/VrrJwBneCP1REtYsOhgVIUKnbLMjg17g=; b=FuLMAB4K+3cu1cYXvFVWoxxYdezkQHtZltXrGopxr5i6EEeGUtpNIbNkhaRQJFXNRH XPaWkuXUHcg4UJzg2ifXD7cVYfihsJgJ8jwJGasVhsXeieIV40FDUMK6VcU62JB6sXmW U2+WU4BBZBdnYmj11XWrN5h0htLlEbu4dnOaYGPsMJvzd/ucLv8FbM8AXjlSA8L7J40r IGNKYGZh57g1lQYVchxZ2pjRZwmqHGrFGeIK2ToTYZPvKtiEj44ktlIyYo7O4RubsqrQ cbTnw0mZhH5eJLZBrymHlZ24wke4Fme/KmB06nZ0kus6TMzif5lE2ejImmbrh7YY7S6A EaZQ== X-Gm-Message-State: AFqh2ko7qWaF66Icw5epwUWC5oCW1RNpABmCmrzCP9geV3CCPHr+N4ML EG0T8vhCxSbsnKlqkLRh0vOAnh7TISp7duNd09PcHpsRq7ccQPj/1JRQ1TlVNnEKLdw0NFdTzxB 94kVDp8q7DFZDRAawODJ/ X-Received: by 2002:a5e:d601:0:b0:6df:fa5a:fa05 with SMTP id w1-20020a5ed601000000b006dffa5afa05mr15825746iom.0.1674429715079; Sun, 22 Jan 2023 15:21:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXv7aTkf11X5wMrwZSb96ndkow6dv+5GGf6t+3U649nWwd0e1rzNsGHWYB6ksr8HFvgMtiRTpw== X-Received: by 2002:a5e:d601:0:b0:6df:fa5a:fa05 with SMTP id w1-20020a5ed601000000b006dffa5afa05mr15825741iom.0.1674429714865; Sun, 22 Jan 2023 15:21:54 -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 n11-20020a02cc0b000000b003755a721e98sm2591349jap.107.2023.01.22.15.21.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Jan 2023 15:21:54 -0800 (PST) Message-ID: <2ce52b78-36c4-4378-da02-c28b3476b10d@redhat.com> Date: Sun, 22 Jan 2023 18:21:53 -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> <2c6cef85-bc1d-2ac3-7a1a-49c732134122@linaro.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <2c6cef85-bc1d-2ac3-7a1a-49c732134122@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=-7.0 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=ham 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/19/23 09:39, Adhemerval Zanella Netto wrote: > Just to confirm that it is for 2.38, since you replied as 2.28 on the patches :}. Yes, 2.38, not 2.28 :-) Thank you, and sorry. > On 18/01/23 19:24, Carlos O'Donell wrote: >> 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.