Documentation ¶
Overview ¶
Package hostmm provides tools for interacting with the host Linux kernel's virtual memory management subsystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTransparentHugepageEnum ¶
GetTransparentHugepageEnum returns the currently selected option for whichever of /sys/kernel/mm/transparent_hugepage/{enabled,shmem_enabled,defrag} is specified by filename. (Only the basename is required, not the full path.)
func GlobalMemoryBarrier ¶
func GlobalMemoryBarrier() error
GlobalMemoryBarrier blocks until "all running threads [in the host OS] have passed through a state where all memory accesses to user-space addresses match program order between entry to and return from GlobalMemoryBarrier", as for membarrier(2).
Preconditions: HaveGlobalMemoryBarrier() == true.
func HaveGlobalMemoryBarrier ¶
func HaveGlobalMemoryBarrier() bool
HaveGlobalMemoryBarrier returns true if GlobalMemoryBarrier is supported.
func HaveProcessMemoryBarrier ¶
func HaveProcessMemoryBarrier() bool
HaveProcessMemoryBarrier returns true if ProcessMemoryBarrier is supported.
func NotifyCurrentMemcgPressureCallback ¶
NotifyCurrentMemcgPressureCallback requests that f is called whenever the calling process' memory cgroup indicates memory pressure of the given level, as specified by Linux's Documentation/cgroup-v1/memory.txt.
If NotifyCurrentMemcgPressureCallback succeeds, it returns a function that terminates the requested memory pressure notifications. This function may be called at most once.
func ProcessMemoryBarrier ¶
func ProcessMemoryBarrier() error
ProcessMemoryBarrier is equivalent to GlobalMemoryBarrier, but only synchronizes with threads sharing a virtual address space (from the host OS' perspective) with the calling thread.
Preconditions: HaveProcessMemoryBarrier() == true.
Types ¶
This section is empty.