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

Optimize iterating over replacement policy purge lists #202

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

eduard-bagdasaryan
Copy link

Before this change RemovalPolicy kept a single list for all entries,
busy (locked) and idle. When entries were purged (by means of
RemovalPurgeWalker), the locked entries were just skipped. Now
we remove this overhead by keeping idle and locked entries
separately.

The optimization should cover two loops purging idle entries:

  • memory entries in freeMemorySpace()

  • disk entries in UFSSwapDir::maintain()

Before this change RemovalPolicy kept a single list for all entries,
busy (locked) and idle. When entries were purged (by means of
RemovalPurgeWalker), the locked entries were just skipped. Now
we remove this overhead by keeping idle and locked entries
separately.

The optimization should cover two loops purging idle entries:

* memory entries in freeMemorySpace()

* disk entries in UFSSwapDir::maintain()
This PR-added field was used to store a pointer to
the current list (busy,idle) and prevent from adding/removing
from the list twice. However, it added additional memory usage
for each StoreEntry.

Now we can remove this memory overhead, as PR204 should
guarantee that we cannot call RemovalPolicy reference/dereference
twice.
This new methods should move the entry between Idle and Busy lists.
primarily removing C-style conversions.

Also check that repl exists in lockInPolicy() methods and fix
unit tests.
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.

1 participant