manager

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GuestRegionUffdMapping added in v1.9.0

type GuestRegionUffdMapping struct {
	BaseHostVirtAddr uint64 `json:"base_host_virt_addr"`
	Size             uint64 `json:"size"`
	Offset           uint64 `json:"offset"`
	PageSize         uint64 `json:"page_size"`
}

GuestRegionUffdMapping describes Firecracker's UFFD guest memory mapping.

type MemoryManager

type MemoryManager struct {
	sync.Mutex
	MemoryManagerCfg
	// contains filtered or unexported fields
}

MemoryManager Serves page faults coming from VMs

func NewMemoryManager

func NewMemoryManager(cfg MemoryManagerCfg) *MemoryManager

NewMemoryManager Initializes a new memory manager

func (*MemoryManager) Activate

func (m *MemoryManager) Activate(vmID string, socketReadyCh chan<- struct{}) error

Activate creates an epoller to serve page faults and reports when the UFFD socket listener is ready for Firecracker to connect.

func (*MemoryManager) Deactivate

func (m *MemoryManager) Deactivate(vmID string) error

Deactivate Removes the epoller which serves page faults for the VM

func (*MemoryManager) DeregisterVM

func (m *MemoryManager) DeregisterVM(vmID string) error

DeregisterVM Deregisters a VM from the memory manager

func (*MemoryManager) DumpUPFLatencyStats

func (m *MemoryManager) DumpUPFLatencyStats(vmID, functionName, latencyOutFilePath string) error

DumpUPFLatencyStats Dumps latency stats collected for the VM

func (*MemoryManager) DumpUPFPageStats

func (m *MemoryManager) DumpUPFPageStats(vmID, functionName, metricsOutFilePath string) error

DumpUPFPageStats Saves the per VM stats

func (*MemoryManager) FetchState

func (m *MemoryManager) FetchState(vmID string) error

FetchState verifies that snapshot state needed by the memory manager exists.

func (*MemoryManager) GetUPFLatencyStats

func (m *MemoryManager) GetUPFLatencyStats(vmID string) ([]*metrics.Metric, error)

GetUPFLatencyStats Returns the gathered metrics for the VM

func (*MemoryManager) PrepareSnapshotLoad added in v1.9.0

func (m *MemoryManager) PrepareSnapshotLoad(cfg SnapshotStateCfg) error

PrepareSnapshotLoad creates or refreshes the state used to serve UFFD faults while loading a VM snapshot.

func (*MemoryManager) RegisterVM

func (m *MemoryManager) RegisterVM(cfg SnapshotStateCfg) error

RegisterVM Registers a VM within the memory manager

type MemoryManagerCfg

type MemoryManagerCfg struct {
	MetricsModeOn bool
}

MemoryManagerCfg Global config of the manager

type Record

type Record struct {
	// contains filtered or unexported fields
}

Record identifies one guest memory page by its offset in the full memory file.

type SnapshotState

type SnapshotState struct {
	SnapshotStateCfg
	// contains filtered or unexported fields
}

SnapshotState Stores the state of the snapshot of the VM.

func NewSnapshotState

func NewSnapshotState(cfg SnapshotStateCfg) *SnapshotState

NewSnapshotState Initializes a snapshot state

type SnapshotStateCfg

type SnapshotStateCfg struct {
	VMID string

	VMMStatePath, GuestMemPath, WorkingSetPath, WorkingSetTracePath string

	InstanceSockAddr string
	BaseDir          string // base directory for the instance
	MetricsPath      string // path to csv file where the metrics should be stored
	IsLazyMode       bool
	GuestMemSize     int
	// contains filtered or unexported fields
}

SnapshotStateCfg Config to initialize SnapshotState

type Trace

type Trace struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Trace stores recorded guest memory page offsets and replay regions.

func (*Trace) AppendRecord

func (t *Trace) AppendRecord(r Record)

func (*Trace) ProcessRecord

func (t *Trace) ProcessRecord(guestMemPath, workingSetPath string, pageSize uint64) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL