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

Startup speed #665

Merged
merged 3 commits into from
Jun 26, 2024
Merged

Startup speed #665

merged 3 commits into from
Jun 26, 2024

Conversation

mjp41
Copy link
Member

@mjp41 mjp41 commented Jun 18, 2024

This improves the startup time for a heavily multi-threaded workload.

There are two improvements that are independent of each other:

  1. Buddy allocator has local cache. The buddy allocator uses the pagemap as backing store. This means that a lot of pages are faulted in at startup for the pagemap, when a large unaligned block is added. This was causing a noticeable time in micro-profiling. The change in this PR makes there be a few entries at the top-level, so we only use the pagemap once a reasonable amount entries are required.
  2. DODUMP/DONTDUMP on Linux were costing a noticeable amount of time, and causing a significant slow down. This PR also exposes a new couple of optional operations on the PAL, and only applies these operations to the Pagemap.

Make it clearer the structure of add_block by pulling out remove_buddy.
@mjp41
Copy link
Member Author

mjp41 commented Jun 19, 2024

After private feedback from @vishalgupta97 and @nwf-msr I am going to put the lock in a separate PR.

mjp41 added 2 commits June 19, 2024 17:38
The do and dont dump calls were costings a lot during start up of snmalloc.  This reduces the times they are called to only be for the pagemap.
@mjp41 mjp41 marked this pull request as ready for review June 19, 2024 18:42
Copy link
Contributor

@nwf-msr nwf-msr left a comment

Choose a reason for hiding this comment

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

LGTM

@mjp41 mjp41 merged commit 4620220 into microsoft:main Jun 26, 2024
47 checks passed
@mjp41 mjp41 deleted the startup_speed branch June 26, 2024 20:34
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