Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
D
darshan
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 71
    • Issues 71
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • darshan
  • darshan
  • Issues
  • #238

Closed
Open
Opened Mar 02, 2018 by Philip Carns@carns
  • Report abuse
  • New issue
Report abuse New issue

Alternative malloc() implementation for Darshan

Darshan already has the ability to use mmap() to manage memory for it's runtime statistics collection, but it also uses a few small malloc() calls at runtime for transient data structures. This can cause problems when interacting with other instrumentation libraries that could invoke POSIX file operations in the malloc path and cause a deadlock (examples include libunwind, hugepages, and alternative malloc implementations).

We've been able to work around this case by case in the past, but John Mellor-Crummey offered this suggestion for a more systemic solution:

What we do in HPCToolkit is just mmap a segment of perhaps 4MB. Then our allocator simply advances a cursor through the segment to provide data. There is no free. I assume that you don’t need to free either. Then, if we out of space in the segment, we mmap another and move the cursor there. Our code as it is a bit specific to HPCToolkit, so you probably don’t want it verbatim. However, it would probably provide a good template for what to do. You can find the few files involved here:

https://github.com/HPCToolkit/hpctoolkit/tree/master/src/tool/hpcrun/memory

Assignee
Assign to
major-feature-request
Milestone
major-feature-request
Assign milestone
Time tracking
None
Due date
None
1
Labels
wrapper libraries
Assign labels
  • View project labels
Reference: darshan/darshan#238