MEMKIND_HBW(3)
π MEMKIND_HBW β high bandwidth memory memkind operations π
ok so bestie. welcome to MEMKIND_HBW(3), the manual page for the high bandwidth memory memkind operations. this is the one where your code gets to hang out with the fast memory. sit down, hydrate, let's go β¨
β οΈ REAL TALK: this is EXPERIMENTAL API. the functionality AND the header file itself can be changed (including non-backward compatible changes) or removed. like, entirely. so don't build your whole personality on it, okay? π«Ά
β¨ SYNOPSIS β¨
int memkind_hbw_check_available(struct memkind *kind);
int memkind_hbw_hugetlb_check_available(struct memkind *kind);
int memkind_hbw_get_mbind_nodemask(struct memkind *kind, unsigned long *nodemask, unsigned long maxnode);
int memkind_hbw_get_preferred_mbind_nodemask(struct memkind *kind, unsigned long *nodemask, unsigned long maxnode);
int memkind_hbw_all_get_mbind_nodemask(struct memkind *kind, unsigned long *nodemask, unsigned long maxnode);
void memkind_hbw_init_once(void);
void memkind_hbw_hugetlb_init_once(void);
void memkind_hbw_all_hugetlb_init_once(void);
void memkind_hbw_preferred_init_once(void);
void memkind_hbw_preferred_hugetlb_init_once(void);
void memkind_hbw_interleave_init_once(void);
πΈ DESCRIPTION πΈ
High bandwidth memory memkind operations. that's the whole vibe. now let's meet the cast π
π§ the checkers
memkind_hbw_check_available()β returns zero if the library was able to detect heterogeneous NUMA node bandwidths. if the detection mechanism failed, you getMEMKIND_ERROR_UNAVAILABLEback instead. also, the detection mechanism can be overridden by the environment variableMEMKIND_HBW_NODES, as described in thememkind(3)man page. iykyk.memkind_hbw_hugetlb_check_available()β in addition to checking for high bandwidth memory as is done bymemkind_hbw_check_available(), this also checks for 2MB huge pages as is done bymemkind_hugetlb_check_available_2mb(). two for one, we love a multitasker π
π the nodemask girlies
memkind_hbw_get_mbind_nodemask()β sets the nodemask bit to one that corresponds to the high bandwidth NUMA nodes that has the closest NUMA distance to the CPU of the calling process. all other bits up to maxnode are set to zero. the nodemask can be used in conjunction with thembind(2)system call.
π Note: the function will fail if two or more high bandwidth memory NUMA nodes are in the same the closest NUMA distance to the CPU of the calling process.
memkind_hbw_get_preferred_mbind_nodemask()β sets the nodemask bit to one that corresponds to the high bandwidth NUMA node that has the closest NUMA distance to the CPU of the calling process. all other bits up to maxnode are set to zero. the nodemask can be used in conjunction with thembind(2)system call.memkind_hbw_all_get_mbind_nodemask()β sets the nodemask bits to one that correspond to the all high bandwidth NUMA nodes in the system. all other bits up to maxnode are set to zero. the nodemask can be used in conjunction with thembind(2)system call. ALL of them. every single one. periodt.
π the init-once-ers
these are giving "call me one time and one time only" energy. literally.
memkind_hbw_init_once()β this function initializesMEMKIND_HBWkind and it should not be called more than once. Note:memkind_hbw_init_once()may reserve some extra memory.memkind_hbw_hugetlb_init_once()β this function initializesMEMKIND_HBW_HUGETLBkind and it should not be called more than once. Note:memkind_hbw_hugetlb_init_once()may reserve some extra memory.memkind_hbw_preferred_init_once()β this function initializesMEMKIND_HBW_PREFERREDkind and it should not be called more than once. Note:memkind_hbw_preferred_init_once()may reserve some extra memory.memkind_hbw_preferred_hugetlb_init_once()β this function initializesMEMKIND_HBW_PREFERRED_HUGETLBkind and it should not be called more than once. Note:memkind_hbw_preferred_hugetlb_init_once()may reserve some extra memory.memkind_hbw_all_hugetlb_init_once()β this function initializesMEMKIND_HBW_ALL_HUGETLBkind and it should not be called more than once. Note:memkind_hbw_all_hugetlb_init_once()may reserve some extra memory.memkind_hbw_interleave_init_once()β this function initializesMEMKIND_HBW_INTERLEAVEkind and it should not be called more than once. Note:memkind_hbw_interleave_init_once()may reserve some extra memory.
π«Ά lowkey the "may reserve some extra memory" note is on every single one of them. not me repeating it six times. that's just the canon, bestie.
π COPYRIGHT π
Copyright (C) 2014 - 2021 Intel Corporation. All rights reserved.
π SEE ALSO π
memkind(3)memkind_arena(3)memkind_default(3)memkind_hugetlb(3)memkind_pmem(3)jemalloc(3)mbind(2)mmap(2)
ok that's the whole page, you ate it, go forth and allocate π β¨
Intel Corporation β 2016-06-13 β MEMKIND_HBW(3) π thanks for reading, bestie, love u, bye π¦
π¦ where this page comes from
- centos-stream 9: memkind-devel 1.11.0-2.el9 Β· BSD
- debian bookworm: libmemkind-dev 1.14.0-2 Β· BSD-3-Clause
- fedora 43: memkind-devel 1.14.0-11.fc43 Β· BSD-2-Clause
- ubuntu jammy: libmemkind-dev 1.13.0-1 Β· BSD-3-Clause
- ubuntu noble: libmemkind-dev 1.14.0-3build1 Β· BSD-3-Clause
- π the page's license: BSD-2-Clause
- Copyright (C) 2014 - 2021 Intel Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms