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

Change '>=' back to '>' to fix recycling of blobs/packets #1192

Merged
merged 1 commit into from
Sep 11, 2018

Conversation

sakridge
Copy link
Member

Recycler will have a strong ref to the item so it will be at
least 1, >= will always prevent recycling.

Copy link
Contributor

@garious garious left a comment

Choose a reason for hiding this comment

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

Gotta have a test for patches like this. Super hard to debug, and no I/O, so easy to test.

@sakridge
Copy link
Member Author

@garious actually how would you test it, since it seems the external effects from going through that path are kind of the same. self.gc.len() will be the same, the only difference is if I got a re-used one or a new one but I'm not sure how I tell the difference in those. I guess I can go with the counter change then I can check those but it seems fragile.

@garious
Copy link
Contributor

garious commented Sep 11, 2018

Modify the packet before recycling and assert_ne!(recycler.allocate(), Packet::default())

@sakridge sakridge force-pushed the fix-strong-count-logic branch from 9139112 to 680e8bf Compare September 11, 2018 23:06
Recycler will have a strong ref to the item so it will be at
least 1, >= will always prevent recycling.
@sakridge sakridge force-pushed the fix-strong-count-logic branch from 680e8bf to da0b1e7 Compare September 11, 2018 23:25
@sakridge
Copy link
Member Author

@garious test added, take a look when you can.

@sakridge sakridge merged commit 297f859 into solana-labs:master Sep 11, 2018
vkomenda pushed a commit to vkomenda/solana that referenced this pull request Aug 29, 2021
…olana-labs#1192)

Bumps [rollup](https://github.com/rollup/rollup) from 2.38.4 to 2.38.5.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](rollup/rollup@v2.38.4...v2.38.5)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Lichtso pushed a commit to Lichtso/solana that referenced this pull request May 6, 2024
* program cache: reduce contention

Before this change we used to take the write lock to extract(). This
means that even in the ideal case (all programs are already cached),
the cache was contended by all batches and all operations were
serialized.

With this change we now take the write lock only when we store a new
entry in the cache, and take the read lock to extract(). This means
that in the common case where most/all programs are cached, there is no
contention and all batches progress in parallel.

This improves node replay perf by 20-25% on current mnb traffic.

* ProgramCache: remove SecondLevel structure
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