checkpoint-restore / criu

Checkpoint/Restore tool
criu.org
Other
2.86k stars 576 forks source link

sockets: Increase the size of sockets hashmap to 16K. #2209

Closed osctobe closed 1 year ago

osctobe commented 1 year ago

During dump, CRIU stores the structs representing sockets in a statically sized hashmap of size 32. We have some (admittedly crazy) tasks that use tens of thousands of sockets, and seem to spend most of the dump time iterating over the linked lists of the map.

16K is chosen arbitrarily, so that it reduces the lengths of the chains to few elements on average, while not introducing significant memory overhead.

mihalicyn commented 1 year ago

please fix https://github.com/checkpoint-restore/criu/pull/2209/checks?check_run_id=14450551879

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -0.07 :warning:

Comparison is base (f018893) 70.61% compared to head (8fb37d6) 70.54%.

:exclamation: Current head 8fb37d6 differs from pull request most recent head bd8280a. Consider uploading reports for the commit bd8280a to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## criu-dev #2209 +/- ## ============================================ - Coverage 70.61% 70.54% -0.07% ============================================ Files 133 133 Lines 33243 33501 +258 ============================================ + Hits 23473 23632 +159 - Misses 9770 9869 +99 ``` | [Impacted Files](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [criu/sockets.c](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2209?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y3JpdS9zb2NrZXRzLmM=) | `84.52% <ø> (-0.04%)` | :arrow_down: | ... and [19 files with indirect coverage changes](https://app.codecov.io/gh/checkpoint-restore/criu/pull/2209/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.