From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id CE4423858D28; Thu, 29 Sep 2022 00:10:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CE4423858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x634.google.com with SMTP id bj12so30248802ejb.13; Wed, 28 Sep 2022 17:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=nbfkFh26cU7/64MUMJ2lsMpyR2zMuHsJfi2sJj6r7Qc=; b=J8N4uIhx2Hmi4YV9lY1jMiUrQAV+GuQm/uwqO3xtUy0oes+RJuH+dU9TKnpPCT8J6t RJHR9zQRVuwttFnr/A6Q6cHWelIiDvnFGmtph+GSbEYxvp18rnU/YBpE4dg6GraYilpz YXyEnBY/CsUYzIjMxvUJ+7ss/LxCnRVa14MyrZrjmgG4e3rEp+sALPFNBAhk0uovejMw bv2PBwYFElY5v2UhP9HxtLzAXm1KtlY/E5Gv5E5LHE7Xgg89V5/52iQ0wq52CeQGdyBK hZroQhckmKHUkmw5FZH1nwHiRPM4NGFNO9ySRRLoyJLDAskzSjE1mJ0uW+g1AMUuSEFb XvDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=nbfkFh26cU7/64MUMJ2lsMpyR2zMuHsJfi2sJj6r7Qc=; b=GXbzGQTr4XO3Y5ltkX6Jc/n6Zv4K5Inx6aVJx9BcDEU4gLDvTnICuoQBKIMMMtcdTi nDr/Nr6YiMNDlaBQT2eMXbAAKAxpXKcSDSYAdRkQyVfIoQCtSsmDPdEvFyD0tpRRO7ou HllgQ7VmnGXVdw0GCOaWAwS0mVmDlAGCBJCL4zpRTPd/mltiiqQcawJEYE5vAL7e/9ev 7x9VlVawsMDPPkF0zyrF+ykxrlv9mz6v8HDoaq2i0OWxJBMwELIc/F7F4wY3puEUMiOH BOGU1uYth0AFmhkbue8122KQu0mOi1JKGYXDkuLDAkME5py/khnKz0bhgclSYD/v1huY LOrg== X-Gm-Message-State: ACrzQf2IAMV3m/hZO2UcOaTqDf67QmZDU33VeIo/LxsFbbHdq7Q/79VF h5sX1ry/U9k5P0yBbjfYS+5WUnPsIGXs62tENZQ= X-Google-Smtp-Source: AMsMyM7ukETQevNkOzuifFC0eAUD3KOxiRS7J6KM+55ljQlaWZNv7ESEOU8UlFjPD3GT8jV1Y4LlyjNuE3nwNuYyNU4= X-Received: by 2002:a17:906:5d04:b0:77f:ca9f:33d1 with SMTP id g4-20020a1709065d0400b0077fca9f33d1mr389194ejt.526.1664410248494; Wed, 28 Sep 2022 17:10:48 -0700 (PDT) MIME-Version: 1.0 References: <20211111162428.2286605-1-hjl.tools@gmail.com> <20211111162428.2286605-2-hjl.tools@gmail.com> <924a80cd-202c-99e9-a2d9-1aeda2235b83@linux.intel.com> In-Reply-To: From: Noah Goldstein Date: Wed, 28 Sep 2022 20:10:37 -0400 Message-ID: Subject: Re: [PATCH v6 1/4] Add LLL_MUTEX_READ_LOCK [BZ #28537] To: Sunil Pandey Cc: Arjan van de Ven , Libc-stable Mailing List , "H.J. Lu" , Florian Weimer , Andreas Schwab , GNU C Library , "Paul A . Clarke" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 Sun, Sep 11, 2022 at 4:19 PM Sunil Pandey wrote: > > On Wed, Nov 17, 2021 at 5:17 PM Arjan van de Ven via Libc-alpha > wrote: > > > > On 11/17/2021 4:31 PM, H.J. Lu wrote: > > >> Yes, but the loop will be able to run `max_cnt` iterations much faster now. > > >> Just wondering if the value needs to be re-tuned. Not that is necessarily needs > > >> to be. > > > Maybe if we can find some data to show for. > > > > > > > wondering when this was last tuned.. I assume todays CPUs and CPUs from, say, 5 or 10 years ago > > have an order of magnitude different performance in this regard.... > > if there wasn't a need to retune during that, maybe this value is so robust that it doesn't need > > retuning. > > > > or maybe it's time to retune this in general sometime soon after this patch goes in ;) > > I would like to backport this patch to release branch 2.33 and 2.34 Fine by me. > > Any comments/suggestions or objections on this. > > commit d672a98a1af106bd68deb15576710cd61363f7a6 > Author: H.J. Lu > Date: Tue Nov 2 18:33:07 2021 -0700 > > Add LLL_MUTEX_READ_LOCK [BZ #28537] > > CAS instruction is expensive. From the x86 CPU's point of view, getting > a cache line for writing is more expensive than reading. See Appendix > A.2 Spinlock in: > > https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/xeon-lock-scaling-analysis-paper.pdf