Conversation
There was a problem hiding this comment.
0.2 does not mean 20% of resources reserved for cache, actually it means for X amount of evictable data, reserve at least 0.2 * X for cache swapping
There was a problem hiding this comment.
0.0 means before loading inevictable data, we can use memory/disk to cache swap evictable data, but inevictable data may eventually be loaded and use up node resources, causing evictable data to not be able to be loaded at all, which is kind of expected behavior if the user choose to configure as such
| std::atomic<int64_t> actual_size_; | ||
| bool evictable_; | ||
| std::atomic<bool> deep_loaded_{false}; | ||
| uid_t uid_; |
There was a problem hiding this comment.
Cell does not need the notion of uid.
| ~Cell() = default; | ||
|
|
||
| // Size management | ||
| int64_t GetEstimatedSize() const { return estimated_size_; } |
There was a problem hiding this comment.
simply use estimated size in this version, remove all attempts towards using actual size.
with this, we can compute and cache size of segment in ctor, so we don't need a lock in Segment's accessors.
| } | ||
|
|
||
| bool SegmentLoadGuard::LoadSegment(std::shared_ptr<Segment> segment) { | ||
| if (!CanLoadSegment(*segment)) { |
There was a problem hiding this comment.
shouldn't this entire CanLoadSegment, if so UpdateShallowUsage be guarded by a lock?
| } CCellInfo; | ||
|
|
||
| // SegmentLoadGuard lifecycle | ||
| CSegmentLoadGuard NewSegmentLoadGuard(CLoadGuardConfig config); |
There was a problem hiding this comment.
we have only a single load guard instance globally
| // ResourceSyncConfig contains configuration for resource synchronization | ||
| type ResourceSyncConfig struct { | ||
| SyncInterval time.Duration | ||
| MemoryCalibInterval time.Duration |
There was a problem hiding this comment.
memory calib is a task in the future, do not do that in this PR and rely solely on OS reported memory usage
No description provided.