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

fix: get_num_blocks_touched logic #661

Merged
merged 1 commit into from
Sep 8, 2024
Merged

fix: get_num_blocks_touched logic #661

merged 1 commit into from
Sep 8, 2024

Conversation

AlpinDale
Copy link
Member

If prefix caching is enabled, and the blocks are swapped out, the left-over caches will be in the evictor group if there are no references. In the meantime, the cache blocks will be evicted, for example, 2 out of 10 cached blocks. Let's say the remaining 8 blocks in the evictor are the last available blocks in the allocator, and the sequence wants to swapped in, the free blocks will count as 8. The touched blocks is calculated as 2, which is incorrect because the cache is not shared by any other blocks. In this case the correct touched blocks should be 10, and can't swap in. In the regular case, if the lookahead slots are more than the free slots, it first need to occupy the block containing the free slots, then plus the remaining required blocks.

@AlpinDale AlpinDale merged commit 1927ce2 into main Sep 8, 2024
5 checks passed
@AlpinDale AlpinDale deleted the fix-touched-blocks branch September 8, 2024 18:23
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