From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by sourceware.org (Postfix) with ESMTPS id EA35C385843B for ; Tue, 7 Sep 2021 17:05:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA35C385843B Received: by mail-qv1-xf32.google.com with SMTP id 62so5036226qvb.11 for ; Tue, 07 Sep 2021 10:05:33 -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:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+2J1c0xrkJMCO2bQArf7f2W6oQFVdLBf4rll//x1opw=; b=MahM51yB1QeTBpw9fnU5JHa9yyYx6ZcLOJWQEvWdnre8cKSr8hDv3KYZU2Sonq4PUL sBqgJHiYNB1vJj3op5y8/h+uPQ+ZsN8knwhlNK7KpFQMnH5knkzk7rYusPFwyyFE/Wnl 9ONJgYkOVVnczJQn0OIH/Y80cDpFeGrjIeOXHyo8sHaCRK8TVbOIR0lgP8wr07hqz2Tg C5ndqFJKbdqcYNzMIYis94XrbvaX04eeMiZY3LT09am5HgMMGR681OaxJcZ8JMVeh6P5 X15zvBiaW+m7gssv+x0LDLEgC0dWLnn9eTC/9S+pYuBLeH8Kz2WnZ3ItHkDhnekNUY2A O1EA== X-Gm-Message-State: AOAM530bZLNHdqKjGLigxUFjBzdqrLT325HJSLYraxt6VN9tNwDT7gEz 6eRbACxrDoVBYZGLi2pZc4gSOg== X-Google-Smtp-Source: ABdhPJzRplLX8YdQ5l8rW8ndmQlHDH6I0rAYWdKuS8vNCsXmkywV9LHv3AciBgiLWugMN/X1ZXtM2g== X-Received: by 2002:ad4:4647:: with SMTP id y7mr18160348qvv.54.1631034333482; Tue, 07 Sep 2021 10:05:33 -0700 (PDT) Received: from ?IPv6:2804:431:c7cb:733d:f360:5bf3:9813:d8f5? ([2804:431:c7cb:733d:f360:5bf3:9813:d8f5]) by smtp.gmail.com with ESMTPSA id b25sm9047446qka.23.2021.09.07.10.05.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 10:05:33 -0700 (PDT) Subject: Re: [PATCH htl v3 0/5] Rewrite THREAD_GSCOPE To: Sergey Bugaev , libc-alpha@sourceware.org, bug-hurd@gnu.org Cc: samuel.thibault@gnu.org References: <20210907133325.255690-1-bugaevc@gmail.com> From: Adhemerval Zanella Message-ID: <80b2464c-5a48-b97f-d68f-042044bf69bf@linaro.org> Date: Tue, 7 Sep 2021 14:05:30 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210907133325.255690-1-bugaevc@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tue, 07 Sep 2021 17:05:35 -0000 On 07/09/2021 10:33, Sergey Bugaev via Libc-alpha wrote: > Hello, > > this is yet another revision of the same patchset to stop issuing many > redundant gsync_wake () calls. Following the brief feedback I got the last > time, it switches most users of THREAD_GSCOPE_IN_TCB to PTHREAD_IN_LIBC, then > actually introduces the new GSCOPE implementation, and then finally drops the > remaining uses of THREAD_GSCOPE_IN_TCB entirely, since it's not always on. > > Things still seem to build and work somewhat (tested on GNU/Hurd i686 and > GNU/Linux x86_64). rpctrace uname still shows that there are no more > gsync_wake () calls. > > Apparently dlopen (RTLD_GLOBAL) is a good way to trigger THREAD_GSCOPE_WAIT (). > I have written a test program that spawns 100 threads, then each of the threads > dlopen's 100 shared objects, then dlclose's them back. On GNU/Linux, I have > verified with GDB that it hits NPTL's __thread_gscope_wait (). I haven't been > able to verify the same on the Hurd due to the general flakiness of GDB there, > but I have ran the program with the patched glibc multiple times and it doesn't > crash, so I assume it's working fine. I can't voucher for Hurd changes, but the generic ones that might affect Linux seems ok (the THREAD_GSCOPE_IN_TCB define is a nice cleanup).