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

measure executor task stack high water mark

    • Server Programmability
    • ALL

      Related to SERVER-64584 but totally separate from it is an idea to install, particularly in service executor threads, some instrumentation that can give us some statistics and/or warnings on how much stack is consumed by a callback. Something like

      https://github.com/mongodb/mongo/blob/5bbadc66ed462aed3cc4f5635c5003da6171c25d/src/mongo/util/stacktrace_test.cpp#L412

      Where we could zero-fill the lower portion of the stack memory, execute the task, and then scan to see where the run of zeros stops, which would traverse all available stack space.

      This technique applied naively would in practice cause the kernel to realize all the stack's virtual memory though by incurring page faults. This could be avoided by writing zeros only when the page isn't already full of zeros. We could also get fancy and ask the kernel about which pages of the stack's virtual memory are untouched to save some CPU time and VM stress (maybe via /proc/self/maps and /proc/self/pagemap). For debug builds maybe we don't care about that level of optimization though.

            Assignee:
            Unassigned Unassigned
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: