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

ARCCache should not keep length of b2 less then p #182

Open
immortal-boy opened this issue Sep 14, 2024 · 0 comments
Open

ARCCache should not keep length of b2 less then p #182

immortal-boy opened this issue Sep 14, 2024 · 0 comments

Comments

@immortal-boy
Copy link

In ARCCache, it want to keep b2.Len() <= p, but in some case b2.Len() may bigger then p.
Example, if size == 10, t1.Len() == 5, t2.Len() == 5, b1.Len() == 5, b2.Len() == 5, p == 5, and then there are 10 datas will hit all cache in t1 and b1, the result is no cache will be remove, and t2.Len() will be 10 and b2.Len() will be 10, the b2.len() will not keep less then p.

It is wrong to keep b2.Len() <=p.
When ARCCache is full, t1.Len() + t2.Len() + b1.Len() + b2.Len() == 2 * size, if t2.Len() + b2.Len() <= size, hit t1 or b1 will make t2.Len() + b2.Len() > size。
When ARCCache is empty, the data stream is x1, x1, x2, x2,...,xt, xt..., all data will into t2, when t1 is full, it means t1.Len() == size, p == 0, no data could into b2.

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

No branches or pull requests

1 participant