From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by sourceware.org (Postfix) with ESMTPS id C00693858D20 for ; Tue, 11 Apr 2023 13:49:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C00693858D20 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-x2e.google.com with SMTP id 586e51a60fabf-1841c57c221so12088776fac.3 for ; Tue, 11 Apr 2023 06:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681220973; x=1683812973; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=cahdjvVSA0xWn5csrd4tmHnepA7I753Fq1fvJh4mmk0=; b=knK4Xz9R1C33dv1kTx3cmD/ZpgKlu3h0IjZPrZsd02sydJ99yvZ7SIrz9Pc1crnRUq wKoHEU5mq77Aq0gRE7kd8Vt0wT0fwPoVhWhv3H+kPrhei/yJ+j5q5fwT/Dr01vHzCF0I m9XxtWeHCOv2dCSECIlppWIKgQekGC8csqF9CLMI77wgB8mGJ32yrvxm8AWsUWLaKI25 ktqJ+CpTS/0Jk2Sv7vO4Uy7qReiRiM9vCObmzNQd8MRKWonugJl4vnK1JWBaP56HDQfk zh8UCGmNH8Qswj0j50KDgFXDtBtAhD7M+LyS7skav/FWWJxGnrEPbgfGg6Qt4CnJBNeT NVzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681220973; x=1683812973; 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=cahdjvVSA0xWn5csrd4tmHnepA7I753Fq1fvJh4mmk0=; b=57oXwfgoWyqLkqevIp2KuckpOZJm1K+hNgefYpWfakOV9bIwiOYN4gOtqeHDDvsDBx 4QryBobbyIAmIzQV9ZlkP56avegRr5R3YM2wq6HxQFuuWP+z/GXNPHgWoE8TU2mFM73z +Y9ZhvhpOi2DExNdPUucAQphXKe2LpwD6m5U/1UhSvtzTnqPKdhPr5GTk83WBvovldv3 OlyJ9KMmGVZO5I9vzePX2AIveUewdEotJSeGPr7BOlWTjS6BOIU/3igXil11ACKQrtk0 RtAVhLt8seExz+uEe3rkCpTzPT2xOGZEpzYtnhoiRCx+MvPaub3GzoZNP/Ept4F4jeSb 2ygQ== X-Gm-Message-State: AAQBX9ddW/CuBwMoMB9H2eo/Ya3lvHdhf3K4X9rwwY3+jGt3vpHO8Vy5 7tIwOo8szwh7Df5yDFIU+nyj1A== X-Google-Smtp-Source: AKy350ZqtcP+NThzqGLg7lNNYWbqpA6jkdZz3KT4ccQjNcSP++NXN2lcxyD1Ph6IQ7NoWZ1Xm18ZJA== X-Received: by 2002:a05:6870:ec8f:b0:172:4748:32d9 with SMTP id eo15-20020a056870ec8f00b00172474832d9mr1795948oab.3.1681220973044; Tue, 11 Apr 2023 06:49:33 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c2:55a1:1474:97d8:bf65:d9d0? ([2804:1b3:a7c2:55a1:1474:97d8:bf65:d9d0]) by smtp.gmail.com with ESMTPSA id zl20-20020a0568716d9400b0017fea9c156esm5124942oab.18.2023.04.11.06.49.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Apr 2023 06:49:32 -0700 (PDT) Message-ID: Date: Tue, 11 Apr 2023 10:49:22 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH v5 10/22] riscv: Fix Race conditions in pthread cancellation [BZ#12683] Content-Language: en-US To: Xi Ruoyao , libc-alpha@sourceware.org Cc: Andrew Waterman References: <20230410195907.4123869-1-adhemerval.zanella@linaro.org> <20230410204614.4129551-1-adhemerval.zanella@linaro.org> <20230410204614.4129551-2-adhemerval.zanella@linaro.org> <6b71d9cc36d83450c8f39d3ce45bb75270f92d58.camel@xry111.site> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <6b71d9cc36d83450c8f39d3ce45bb75270f92d58.camel@xry111.site> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 11/04/23 04:01, Xi Ruoyao wrote: > On Tue, 2023-04-11 at 14:35 +0800, Xi Ruoyao wrote: >> On Mon, 2023-04-10 at 17:46 -0300, Adhemerval Zanella via Libc-alpha >> wrote: >>> +1: >>> +       addi    sp, sp, -16 >>> +       cfi_def_cfa_offset (16) >>> +       REG_S   ra, (16-SZREG)(sp) >>> +       cfi_offset (ra, -SZREG) >>> +       call    __syscall_do_cancel >> >> Similarly to LoongArch, IMO this should simply be >> "tail __syscall_do_cancel". >> >> Apparently _Noreturn is preventing GCC from generating a tail call for >> RISC-V and LoongArch > > Actually "everywhere" (but why the AArch64 code seems optimized?) I hand optimized on some architectures, like x86_64 and aarch64. For most of the other architectures I just modeled after compiler generated call. > >> so if you modeled the assembly following the GCC >> output you'll get these sub-optimal things.  It seems a GCC bug to me. > > It's https://gcc.gnu.org/PR10837 and closed as WONTFIX 20 years ago :(. > And a comment from H.J. complained an impact on Glibc. > >