Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-2123

glibc: TLS performance degradation when loading two or more threads [rhel-9.4]

    • glibc-2.34-87.el9
    • Normal
    • sst_pt_libraries
    • ssg_platform_tools
    • 12
    • 15
    • 2
    • QE ack, Dev ack
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Bug Fix
    • Hide
      .Consistently fast `glibc` thread-local storage performance

      Previously, the `glibc` dynamic linker did not adjust certain thread-local storage (TLS) metadata after shared objects with TLS were loaded by using the `dlopen()` function, which consequently caused slow TLS access. With this update, the dynamic linker now updates TLS metadata for TLS changes caused by `dlopen()` calls. As a result, TLS access is consistently fast.
      Show
      .Consistently fast `glibc` thread-local storage performance Previously, the `glibc` dynamic linker did not adjust certain thread-local storage (TLS) metadata after shared objects with TLS were loaded by using the `dlopen()` function, which consequently caused slow TLS access. With this update, the dynamic linker now updates TLS metadata for TLS changes caused by `dlopen()` calls. As a result, TLS access is consistently fast.
    • Done
    • None

      Description of problem: When two separate threads load TLS library functions sequentially, one thread will be very slow due to a generation counter mismatch (and thus glibc thinking it needs to reallocate memory for it).

      Version-Release number of selected component (if applicable):
      2.28-164.el8.x86_64

      How reproducible: 100%

      Steps to Reproduce:
      1. yum install gcc gcc-c++ make glibc-devel openssl-devel
      2. Unzip shell archive with test case.
      3. Run "make".
      4. Execute program "tls-test".

      Actual results:
      One thread is slower than the other to access TLS variables:

      none loaded
      main normal variable : 554.770ms
      main thread-local variable : 578.829ms
      lib1 loaded
      main normal variable : 536.941ms
      main thread-local variable : 504.300ms
      lib1 variable : 2079.362ms
      lib2 loaded
      main normal variable : 451.575ms
      main thread-local variable : 434.603ms
      lib1 variable : 5567.543ms
      lib2 accessed
      main normal variable : 424.644ms
      main thread-local variable : 429.140ms
      lib1 variable : 1911.933ms

      Expected results: lib1 variable access time is consistent.

      Additional info:

            fweimer@redhat.com Florian Weimer
            fweimer@redhat.com Florian Weimer
            Florian Weimer Florian Weimer
            Sergey Kolosov Sergey Kolosov
            Jacob Valdez Jacob Valdez
            Votes:
            0 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: