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

Factor check client into separate features #587

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

mjp41
Copy link
Member

@mjp41 mjp41 commented Feb 3, 2023

All the checks and mitigations have been placed under feature flags.
These can be controlled by defining

SNMALLOC_CHECK_CLIENT_MITIGATIONS

This can take a term that represents the mitigations that should be enabled.
E.g.
-DSNMALLOC_CHECK_CLIENT_MITIGATIONS=nochecks+random_pagemap

The CMake uses this to build numerous versions of the LD_PRELOAD library and
tests to allow individual features to be benchmarked.

@mjp41
Copy link
Member Author

mjp41 commented Feb 3, 2023

This still needs a lot of documenting, and some cmake magic to build the many different versions. I have posted a draft PR for CI feedback, and early comments on the shape.

@mjp41 mjp41 force-pushed the split_check_client branch 2 times, most recently from 039918f to eae588c Compare February 9, 2023 20:51
@mjp41 mjp41 marked this pull request as ready for review February 10, 2023 21:41
@mjp41 mjp41 force-pushed the split_check_client branch 6 times, most recently from eb600cb to a26a5ca Compare February 23, 2023 16:18
@mjp41
Copy link
Member Author

mjp41 commented Feb 23, 2023

Here is a run of cfrac from mimalloc-bench with the various mitigations turned on in sequence:

  • sn-m0 is no mitigations
  • sn-m1 is metadata_protection
  • sn-m2 is sn-m1 + pal_enforce_access
  • sn-m3 is sn-m2 + random_pagemap
  • sn-m4 is sn-m3 + sanity_checks
  • sn-m5 is sn-m4 + freelist_forward_edge
  • sn-m6 is sn-m5 + freelist_backward_edge
  • sn-m7 is sn-m6 + freelist_teardown_validate
  • sn-m8 is sn-m7 + reuse_LIFO
  • sn-m9 is sn-m8 + random_larger_thresholds
  • sn-m10 is sn-m9 + random_initial
  • sn-m11 is sn-m10 + random_preserve
  • sn-m12 is sn-m11 + random_extra_slab
  • sn-chk is sn-m12 + Guarded Memcpy
  • mi is mimalloc 1.7.7 (given for a point of comparison)

WARNING: Truncated axes.

graph

(Graph based on @jvoisin's script in mimalloc-bench)

@mjp41 mjp41 force-pushed the split_check_client branch 2 times, most recently from 77b074d to f44a400 Compare February 23, 2023 17:06
All the checks and mitigations have been placed under feature flags.
These can be controlled by defining

  SNMALLOC_CHECK_CLIENT_MITIGATIONS

This can take a term that represents the mitigations that should be enabled.
E.g.
  -DSNMALLOC_CHECK_CLIENT_MITIGATIONS=nochecks+random_pagemap

The CMake uses this to build numerous versions of the LD_PRELOAD library and
tests to allow individual features to be benchmarked.

Co-authored-by: Nathaniel Wesley Filardo <nfilardo@microsoft.com>
@mjp41 mjp41 merged commit ccca98a into microsoft:main Mar 23, 2023
@mjp41 mjp41 deleted the split_check_client branch March 23, 2023 13:41
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.

None yet

1 participant