Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-87145

Investigate hooking into spinlock for delay statistics in new tcmalloc

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Service Arch 2024-04-01

      In the new version of tcmalloc, the spinlock_total_delay_ns statistics is not available at all. This statistic has been useful for diagnosing tcmalloc issues in the past, and so it is too bad that the new tcmalloc has removed this metric.

      However, abseil's spinlock implementation, which is used by tcmalloc, does allow us to hook into and profile a spinlock (https://github.com/mongodb/mongo/blob/5e0f333d011b973fc7d44f48bbd0fc6ea34b6be1/src/third_party/abseil-cpp/dist/absl/base/internal/spinlock.h#L214C6-L215). We should investigate using this to get the spinlock delay information, and also ensure that using it does not cause a performance hit to the allocator.

            Assignee:
            erin.mcnulty@mongodb.com Erin McNulty
            Reporter:
            erin.mcnulty@mongodb.com Erin McNulty
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: