hostmm

package
v0.0.0-...-2b55090 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0, MIT Imports: 10 Imported by: 6

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

func GetTransparentHugepageEnum(filename string) (string, error)

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

func NotifyCurrentMemcgPressureCallback(f func(), level string) (func(), error)

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.

Jump to

Keyboard shortcuts

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