Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#5411 bbdup mem: Shrink per-thread heap usage #5419

Merged
merged 3 commits into from
Mar 15, 2022

Conversation

derekbruening
Copy link
Contributor

@derekbruening derekbruening commented Mar 14, 2022

Moves all drbbdup per-thread memory to unreachable heap.

Moves the drbbdup dynamic case hit table to be dynamically allocated
based on a new drbbdup option "never_enable_dynamic_handling" not
being set. This eliminates 128K per thread for drmemtrace, which
makes a big difference on large applications.

Sanity test:
Before:

  $ bin64/drrun -rstats_to_stderr -t drcachesim -offline -max_global_trace_refs 10K -- suite/tests/bin/client.annotation-concurrency libclient.annotation-concurrency.appdll.so A 4 64 3
              Peak threads under DynamoRIO control :                 5
              Peak vmm blocks for unreachable heap :               767
                Peak vmm blocks for reachable heap :               726
            Peak vmm virtual memory in use (bytes) :          10293248

After:

              Peak threads under DynamoRIO control :                 5
              Peak vmm blocks for unreachable heap :               736
                Peak vmm blocks for reachable heap :               250
            Peak vmm virtual memory in use (bytes) :           8183808

Issue: #5411

Moves all drbbdup per-thread memory to unreachable heap.

Moves the drbbdup dynamic case hit table to be dynamically allocated
based on a new drbbdup option "never_enable_dynamic_handling" not
being set.  This eliminates 128K per thread for drmemtrace, which
makes a big difference on large applications.

Sanity test:
Before:
  $ bin64/drrun -rstats_to_stderr -t drcachesim -offline -max_global_trace_refs 10K -- suite/tests/bin/client.annotation-concurrency libclient.annotation-concurrency.appdll.so A 4 64 3
              Peak threads under DynamoRIO control :                 5
              Peak vmm blocks for unreachable heap :               767
                Peak vmm blocks for reachable heap :               726
            Peak vmm virtual memory in use (bytes) :          10293248
After:
              Peak threads under DynamoRIO control :                 5
              Peak vmm blocks for unreachable heap :               736
                Peak vmm blocks for reachable heap :               250
            Peak vmm virtual memory in use (bytes) :           8183808

Issue: #5411
Copy link
Contributor

@johnfxgalea johnfxgalea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you sprinkle some asserts in the code-base where opts.never_enable_dynamic_handling should be false. Maybe somewhere close to the beginning of the following functions:

  • init_fp_cache()
  • drbbdup_handle_new_case()
  • drbbdup_insert_dynamic_handling()

ext/drbbdup/drbbdup.c Show resolved Hide resolved
@derekbruening
Copy link
Contributor Author

Can you sprinkle some asserts in the code-base where opts.never_enable_dynamic_handling should be false. Maybe somewhere close to the beginning of the following functions:

  • init_fp_cache()
  • drbbdup_handle_new_case()
  • drbbdup_insert_dynamic_handling()

Done.

@derekbruening
Copy link
Contributor Author

win64 failure is burst_traceopts/replaceall hitting #4486

@derekbruening derekbruening merged commit 6e16e55 into master Mar 15, 2022
@derekbruening derekbruening deleted the i5411-bbdup-thread-heap branch March 15, 2022 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants