---
name: "memkind_hugetlb"
section: "3"
platform: "linux"
package: "libmemkind-dev"
version: "1.14.0-2"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/memkind_hugetlb"
---

# memkind\_hugetlb(3)

hugetlb memory memkind operations. Note: This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed.

## NAME

memkind\_hugetlb - hugetlb memory memkind operations.\
 **Note:** This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed.

## SYNOPSIS

**int memkind\_hugetlb\_check\_available\_2mb(struct memkind** *\*kind***);**\
 **int memkind\_hugetlb\_get\_mmap\_flags(struct memkind** *\*kind***, int** *\*flags***);**\
 **void memkind\_hugetlb\_init\_once(void);**\

## DESCRIPTION

The hugetlb memory memkind operations enable memory kinds which use the Linux hugetlbfs file system.  For more information about the hugetlbfs see link below.\
 ⟨https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt⟩

**memkind\_hugetlb\_check\_available\_2mb**() check if there are 2MB pages reserved in the default hugetlbfs.  If the kind implements **ops.get\_mbind\_nodemask**(), then only the NUMA nodes set by the nodemask are checked, otherwise every NUMA node is checked.

**memkind\_hugetlb\_get\_mmap\_flags**() sets the flags for the **mmap**() system call such that the hugetlbfs is utilized for allocations.

**memkind\_hugetlb\_init\_once**() this function initializes **MEMKIND\_HUGETLB** kind and it should not be called more than once. **Note:** **memkind\_hugetlb\_init\_once**() may reserve some extra memory.

## COPYRIGHT

Copyright (C) 2014 - 2020 Intel Corporation. All rights reserved.

## SEE ALSO

[**memkind**(3)](/memkind/3.md), [**memkind\_arena**(3)](/memkind_arena/3.md), [**memkind\_default**(3)](/memkind_default/3.md), [**memkind\_hbw**(3)](/memkind_hbw/3.md), [**memkind\_pmem**(3)](/memkind_pmem/3.md), [**jemalloc**(3)](/jemalloc/3.md), [**mbind**(2)](/mbind/2.md), [**mmap**(2)](/mmap/2.md)
