Skip to content

Multi tier shm attach #99

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

Merged
merged 1 commit into from
Jun 13, 2024
Merged

Multi tier shm attach #99

merged 1 commit into from
Jun 13, 2024

Conversation

byrnedj
Copy link

@byrnedj byrnedj commented Dec 1, 2023

I disabled slab release in test due to some error with pruneFreeAllocations - we can discuss if there is a simple solution to storing multi-tier/single tier compressed pointer in the FreeLists (see AllocationClass.cpp and pruneFreeAllocations method.

The test also sporadically fails due to difficulties in estimating multi-tier LRU size. The current estimation method inserts an new item to the cache and waits for it to be evicted after a number of successive allocations of new arbitrary objects. The problems are the following:

  • new item could fail being allocated in tier 0 so it is allocated in tier 1 and therefore will be evicted more quickly causing LRU size estimate to be too small.
  • new item could fail being moved from tier 0 so it is evicted from cache, causing estimate to be too small again.

I'm open to suggestions on how to improve the LRU estimation or test.


This change is Reviewable

@byrnedj byrnedj requested review from vinser52 and igchor December 1, 2023 22:00
@igchor
Copy link
Member

igchor commented Dec 4, 2023

@byrnedj Is the problem with LRU estimation caused by the fact that we allocate items with different sizes? Could we just use single allocation size for this test?

Also, I think you should split the testMultiTierSerialization into 2 tests.

@byrnedj
Copy link
Author

byrnedj commented Dec 4, 2023

@byrnedj Is the problem with LRU estimation caused by the fact that we allocate items with different sizes? Could we just use single allocation size for this test?

No, the problem is that in multi-tier the entire LRU (compared to single tier) is split between tier 0 and tier 1, and if we fail to move an item from tier 0 to tier 1, it gets evicted, so the estimation technique will think LRU size is however many items it took for that item to get evicted. And because it was evicted out of tier 0 - then the estimation will too small. Because actual LRU size (tier 0 + tier 1) would be when the item gets evicted out of tier 1.

Also, I think you should split the testMultiTierSerialization into 2 tests.
Will do.

@igchor
Copy link
Member

igchor commented Dec 4, 2023

@byrnedj Is the problem with LRU estimation caused by the fact that we allocate items with different sizes? Could we just use single allocation size for this test?

No, the problem is that in multi-tier the entire LRU (compared to single tier) is split between tier 0 and tier 1, and if we fail to move an item from tier 0 to tier 1, it gets evicted, so the estimation technique will think LRU size is however many items it took for that item to get evicted. And because it was evicted out of tier 0 - then the estimation will too small. Because actual LRU size (tier 0 + tier 1) would be when the item gets evicted out of tier 1.

Also, I think you should split the testMultiTierSerialization into 2 tests.
Will do.

But why does moving the items fail? Can't we perform item insertion deterministically?

@byrnedj byrnedj force-pushed the multi-tier-shm-attach branch from 0f92147 to 1e8481b Compare February 29, 2024 14:43
@byrnedj
Copy link
Author

byrnedj commented Feb 29, 2024

@byrnedj Is the problem with LRU estimation caused by the fact that we allocate items with different sizes? Could we just use single allocation size for this test?

No, the problem is that in multi-tier the entire LRU (compared to single tier) is split between tier 0 and tier 1, and if we fail to move an item from tier 0 to tier 1, it gets evicted, so the estimation technique will think LRU size is however many items it took for that item to get evicted. And because it was evicted out of tier 0 - then the estimation will too small. Because actual LRU size (tier 0 + tier 1) would be when the item gets evicted out of tier 1.

Also, I think you should split the testMultiTierSerialization into 2 tests.
Will do.

But why does moving the items fail? Can't we perform item insertion deterministically?

Using only 1 class removes the tests LRU estimation failure. I updated the test accordingly.

I don't think it makes sense to split into two cases since testMultiTierSerialization should create a cache and then try to reattach to it (verifying the expected state).

@byrnedj byrnedj force-pushed the multi-tier-shm-attach branch from 1e8481b to 7adad89 Compare April 17, 2024 16:37
@byrnedj byrnedj force-pushed the develop branch 2 times, most recently from 09d7bab to ebfca17 Compare May 21, 2024 13:24
@byrnedj byrnedj force-pushed the multi-tier-shm-attach branch from 7adad89 to 23f1100 Compare June 13, 2024 18:29
@byrnedj byrnedj merged commit efeb74b into develop Jun 13, 2024
1 of 5 checks passed
@byrnedj byrnedj deleted the multi-tier-shm-attach branch June 13, 2024 18:30
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