kuznet@xxxxxxxxxxxxx writes:
> Robert, look, the idea is:
>
> 1. Periodically we reset elasticity2 to 2*elasticity, f.e. from
> periodic gc timer.
This solve the "positive" feedback. Actually the code I tested moved
from elasticity2=1 to elasticity*2 as well but this seems more reliable.
> 2. We measure hits and misses with higher frequency, f.e. from
> forced gc. The measurement are suppressed for some time
> after each flush while cache collects new fresh entries.
And the measure (forced gc) should not be inhibited by any elastiticy2
setting.
> if (misses > rt_hash_mask+1 && hits < misses)
> elasticity2 = 0;
> else
> elasticity2 = 2*elasticity;
( hits < misses )
Delicate balancing point but actually it didn't look too bad in the
lab setup.
> misses > rt_hash_mask+1 guarantees that cache is populated and probed
> enough, rt_hash_mask+1 is not a random number, it corresponds
> to maximal size with elasticity2 = 0.
Yes better.
> Seems, it should work. And it is simple enough.
Let's try... ;-)
Cheers.
--ro
|