Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
329 changes: 279 additions & 50 deletions ydb/library/actors/interconnect/rdma/mem_pool.cpp

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions ydb/library/actors/interconnect/rdma/mem_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ namespace NMonitoring {
struct TDynamicCounters;
}

struct TMemRegCompare;
namespace NInterconnect::NRdma {

class IMemPool;
class TMemRegion;
class TChunk;
class TMemPoolImpl;
class TSlotMemPool;

using TChunkPtr = TIntrusivePtr<TChunk>;

class TMemRegion: public NNonCopyable::TMoveOnly, public IContiguousChunk {
friend struct ::TMemRegCompare;
friend class TSlotMemPool;
public:
TMemRegion(TChunkPtr chunk, uint32_t offset, uint32_t size) noexcept;
TMemRegion(TMemRegion&& other) noexcept = default;
Expand All @@ -35,16 +39,16 @@ namespace NInterconnect::NRdma {
uint32_t GetLKey(size_t deviceIndex) const;
uint32_t GetRKey(size_t deviceIndex) const;

void Resize(uint32_t newSize) noexcept;

public: // IContiguousChunk
TContiguousSpan GetData() const override;
TMutableContiguousSpan UnsafeGetDataMut() override;
size_t GetOccupiedMemorySize() const override;
EInnerType GetInnerType() const noexcept override;
IContiguousChunk::TPtr Clone() noexcept override;
protected:
void Resize(uint32_t newSize) noexcept;
TChunkPtr Chunk;
ui64 Generation = 0;
const uint32_t Offset;
uint32_t Size;
const uint32_t OrigSize;
Expand Down Expand Up @@ -97,9 +101,9 @@ namespace NInterconnect::NRdma {
virtual TString GetName() const noexcept = 0;

protected:
virtual TMemRegion* AllocImpl(int size, ui32 flags) noexcept = 0;
virtual TMemRegionPtr AllocImpl(int size, ui32 flags) noexcept = 0;
virtual void Free(TMemRegion&& mr, TChunk& chunk) noexcept = 0;
virtual void DealocateMr(std::vector<ibv_mr*>& mrs) noexcept = 0;
virtual void DealocateMr(TChunk*) noexcept = 0;
private:
virtual void Tick(NMonotonic::TMonotonic time) noexcept = 0;
};
Expand Down

This file was deleted.

Loading
Loading