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 ESMTP id E7380395183B for ; Sun, 9 May 2021 21:42:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E7380395183B Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-580-yu5UDpfJMgm0F7ABeZAfYQ-1; Sun, 09 May 2021 17:42:19 -0400 X-MC-Unique: yu5UDpfJMgm0F7ABeZAfYQ-1 Received: by mail-qv1-f69.google.com with SMTP id d21-20020a0caa150000b02901e2ed83f922so3715992qvb.4 for ; Sun, 09 May 2021 14:42:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=KkdFfLKFShrDFXEvqSLa6OutA1Uuv1Z9lbb0tW2m9Ic=; b=nQdYezfUeAb3YOV/fWIpjnAELJvt94Eh0B3vL+Q/Do246dftg2rLatHTdmkdS/z0Wo 7wbDaBLrRqwJTOX9cpyIX8DB/XF7GLUzmKW4byN7lY40r2VEmTS6aj4E07I0HhQxggLI Ct5sEosgi8aXUNNmz+VGY9PhlH1SVeWtWNqdHKA2DafQF0TMuw/HUMTHjUbCQUt+n1Ln xhXQHsHwKxVLK57tCCBpSQYCYozj2y0PeV/s41miPDCP3aAdPCnFa3Ri6152zKAjUA/W zn4ePdqi796lBWhqwC0mu+HVxXroSNC1GSSzBTs17IKNuBoHxQFFC9lFmdlE8LS03a6/ b2Cg== X-Gm-Message-State: AOAM5326M+zK4r6B/GR0CrLHQk0UhHy8hLWLVhV32tU+BTbf7iz3ZGbh RW8l4/d/E+zRIutVmfU93i/o1iG50nTd5b9YfFomISSVwNcAAC2xA4W0fvk+PJfMNOSPdGiRqua 8IdAmD7WB0O+D9WVJpe7GzrhISDbdIaKFIHBiQltm42yQSPeOtWMPvxTIcT5J1zbDCdIOdw== X-Received: by 2002:a05:622a:1189:: with SMTP id m9mr13037882qtk.277.1620596539126; Sun, 09 May 2021 14:42:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKZO+mycCpV61o7yQ067H9Db5I0N8nJI4OUWNZGwRMD03SitlD3SFbFD19mNlZ7P9iEkq7SQ== X-Received: by 2002:a05:622a:1189:: with SMTP id m9mr13037874qtk.277.1620596538912; Sun, 09 May 2021 14:42:18 -0700 (PDT) Received: from [192.168.1.16] (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id c26sm9807985qtj.92.2021.05.09.14.42.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 May 2021 14:42:18 -0700 (PDT) Subject: Re: [PATCH 04/13] Linux: Explicitly disable cancellation checking in the dynamic loader To: Florian Weimer , libc-alpha@sourceware.org References: <6570a09c7a6652d387548c8af2dd39fc37df9174.1620323953.git.fweimer@redhat.com> From: Carlos O'Donell Organization: Red Hat Message-ID: <82a0bcd9-bbc1-6a20-3571-91dc24fade41@redhat.com> Date: Sun, 9 May 2021 17:42:17 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <6570a09c7a6652d387548c8af2dd39fc37df9174.1620323953.git.fweimer@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Sun, 09 May 2021 21:42:23 -0000 On 5/6/21 2:10 PM, Florian Weimer via Libc-alpha wrote: > Historically, SINGLE_THREAD_P is defined to 1 in the dynamic loader. > This has the side effect of disabling cancellation points. In order > to enable future use of SINGLE_THREAD_P for single-thread > optimizations in the dynamic loader (which becomes important once > more code is moved from libpthread), introduce a new > NO_SYSCALL_CANCEL_CHECKING macro which is always 1 for IS_IN (rtld), > indepdently of the actual SINGLE_THREAD_P value. LGTM. Tested on x86_64 and i686 without regression. Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell > --- > sysdeps/unix/sysdep.h | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h > index 2fa6bfa135..664d093c05 100644 > --- a/sysdeps/unix/sysdep.h > +++ b/sysdeps/unix/sysdep.h > @@ -88,10 +88,17 @@ > #define INLINE_SYSCALL_CALL(...) \ > __INLINE_SYSCALL_DISP (__INLINE_SYSCALL, __VA_ARGS__) > > +#if IS_IN (rtld) > +/* All cancellation points are compiled out in the dynamic loader. */ > +# define NO_SYSCALL_CANCEL_CHECKING 1 > +#else > +# define NO_SYSCALL_CANCEL_CHECKING SINGLE_THREAD_P > +#endif > + > #define SYSCALL_CANCEL(...) \ > ({ \ > long int sc_ret; \ > - if (SINGLE_THREAD_P) \ > + if (NO_SYSCALL_CANCEL_CHECKING) \ > sc_ret = INLINE_SYSCALL_CALL (__VA_ARGS__); \ > else \ > { \ > @@ -107,7 +114,7 @@ > #define INTERNAL_SYSCALL_CANCEL(...) \ > ({ \ > long int sc_ret; \ > - if (SINGLE_THREAD_P) \ > + if (NO_SYSCALL_CANCEL_CHECKING) \ > sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \ > else \ > { \ > -- Cheers, Carlos.