Kkubevirt-botfix(ksm): re-introduce time based ksm handler
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
hack: Run bazel-race Signed-off-by: Lee Yarwood <lyarwood@redhat.com> | 8 个月前 | |
Create a generic cache struct The main idea is that when the Get() method is called, the cache would either re-calculate the value or return the cached value according to the parameters passed to it during its creation. This cache gets a few parameters: * minRefreshDuration: If the value is requested before the minRefreshDuration has passed, the cached value will be returned. If minRefreshDuration is zero, the value will always be recalculated. * useValueLock: which hurts performance a bit, but makes the cache thread-safe. * reCalcFunc: a function to re-calculate the desired value. The value can be also explicitly set with Set(). Signed-off-by: Itamar Holder <iholder@redhat.com> | 2 年前 | |
fix(ksm): re-introduce time based ksm handler Currently, the ksm handler is spin only when the KV config is changed. This means that in case of node pressure, without a KV config change, the ksm will not be enabled. IOW the ksm handler is not properly working, since it should be enabled in case of node pressure without any external intervention, and be stopped once the node pressure ends. Re-introduce the time based node pressure check. The main logic is the following: - if node matches the ksm label config, then start the ksm node pressure loop. - if node does not match the ksm label config, then stop the ksm node pressure loop and disable ksm. - during the ksm node pressure loop, in case of node pressure enable ksm, disable otherwise. Signed-off-by: fossedihelm <ffossemo@redhat.com> | 7 个月前 | |
Add a one-shot cache OneShotCache is a cache that calculates its value only once. It will use the provided calculation function to get the value. Once a first call to this function results in a non-error value, the cache will return this value for all subsequent calls. Signed-off-by: Itamar Holder <iholder@redhat.com> | 1 年前 | |
time-defined-cache: add a function to set the re-calc function Signed-off-by: Itamar Holder <iholder@redhat.com> | 1 年前 | |
cache: fix race test By definition, NewTimeDefinedCache can be race if useValueLock is false. This can be useful in production (even if not used), but not for the scope of testing if value is updated. And also, this is causing a data race detection. Signed-off-by: fossedihelm <ffossemo@redhat.com> | 8 个月前 |