[PATCH v6 1/4] Add LLL_MUTEX_READ_LOCK [BZ #28537]

Sunil Pandey skpgkp2@gmail.com
Sun Sep 11 20:19:15 GMT 2022


On Wed, Nov 17, 2021 at 5:17 PM Arjan van de Ven via Libc-alpha
<libc-alpha@sourceware.org> 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

Any comments/suggestions or objections on this.

commit d672a98a1af106bd68deb15576710cd61363f7a6
Author: H.J. Lu <hjl.tools@gmail.com>
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


More information about the Libc-stable mailing list