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

Marksweep is slower in most benchmarks after #953 #1135

Open
qinsoon opened this issue May 15, 2024 · 1 comment
Open

Marksweep is slower in most benchmarks after #953 #1135

qinsoon opened this issue May 15, 2024 · 1 comment
Labels
C-regression Category: Correctness or performance regression P-high Priority: High. A high-priority issue should be fixed as soon as possible.

Comments

@qinsoon
Copy link
Member

qinsoon commented May 15, 2024

We see between 1% to 6% (pmd) slowndown in CI for OpenJDK after #953 (hammer-2024-05-10-Fri-144600).

@qinsoon qinsoon added the C-regression Category: Correctness or performance regression label May 15, 2024
@udesou udesou added the P-high Priority: High. A high-priority issue should be fixed as soon as possible. label May 15, 2024
@wks
Copy link
Collaborator

wks commented May 15, 2024

There are several possible reasons.

  1. The PR Remove fl_map and refactor FreeListPageResoure #953 expanded the scope of the mutex lock in FreeListPageResource::release_pages. Now it holds the mutex lock while (1) querying the free_list.size, and (2) calling self.mprotect (LOS only).
  2. The Rust compiler makes different inlining decisions after Remove fl_map and refactor FreeListPageResoure #953, making it slower.

Since the CI is not using PGO, the inlining decision is more likely to be the cause.

But the way MarkSweep sweeps block may be a bottleneck, too. MarkSweep executes SweepChunk in parallel, but whenever freeing any particular block, it needs to hold a mutex lock (even before #953).

We should look at the eBPF trace of MarkSweep to find its true inefficiency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-regression Category: Correctness or performance regression P-high Priority: High. A high-priority issue should be fixed as soon as possible.
Projects
None yet
Development

No branches or pull requests

3 participants