Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !4441

i#4424: Adjust guard pages and unit sizes for >4K pages

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Derek Bruening requested to merge i4424-large-page-ops-sizes into master Sep 09, 2020
  • Overview 5
  • Commits 2
  • Pipelines 0
  • Changes 8

Adds a new option -per_thread_guard_pages controlling whether per-thread allocations have guard pages. This option is turned off by default for >4K pages, removing guard pages from thread-private initial cache units, all thread-private heap units, thread-private signal-pending special heap units, stacks, TLS segments (DR and privlib), and thread-private gencode. This saves a lot of space on many-threaded apps, while maintaining guards throughout the VMM from shared units, which are used far more often than private these days.

Implements the option with a new VMM flag VMM_PER_THREAD, added to the reservation calls for the above list of unit types.

Additionally, for >4K pages, tunes the default unit sizes to take into account the guard changes. Increases the shared unit sizes further for a better ratio of content to guard pages.

Tested on a large app on a 64K-page machine which originally hit OOM without "-no_guard_pages" before (along with other now-fixed bugs: i#4335; i#4418). Here are some stats for a smaller version of the app that is easier to capture statistics for:

-no_guard_pages: Peak threads under DynamoRIO control : 152 Threads ever created : 701 Peak vmm blocks for unreachable heap : 914 Peak vmm blocks for stack : 610 Peak vmm blocks for unreachable special heap : 152 Peak vmm blocks for unreachable special mmap : 304 Peak vmm blocks for reachable heap : 161 Peak vmm blocks for cache : 368 Peak vmm blocks for reachable special mmap : 5 Peak vmm virtual memory in use (bytes) : 164757504

Here's this PR with -per_thread_guard_pages (i.e., overriding the new default: so matching the HEAD defaults): Peak threads under DynamoRIO control : 157 Threads ever created : 706 Peak vmm blocks for unreachable heap : 1690 Peak vmm blocks for stack : 945 Peak vmm blocks for unreachable special heap : 471 Peak vmm blocks for unreachable special mmap : 942 Peak vmm blocks for reachable heap : 482 Peak vmm blocks for cache : 741 Peak vmm blocks for reachable special mmap : 7 Peak vmm virtual memory in use (bytes) : 345899008

Vs the new defaults in this PR: Peak threads under DynamoRIO control : 141 Threads ever created : 701 Peak vmm blocks for unreachable heap : 884 Peak vmm blocks for stack : 566 Peak vmm blocks for unreachable special heap : 141 Peak vmm blocks for unreachable special mmap : 282 Peak vmm blocks for reachable heap : 152 Peak vmm blocks for cache : 411 Peak vmm blocks for reachable special mmap : 7 Peak vmm virtual memory in use (bytes) : 160104448

Fixes #4424 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i4424-large-page-ops-sizes