1MEMKIND_PMEM(3) MEMKIND_PMEM MEMKIND_PMEM(3)
2
3
4
6 memkind_pmem - file-backed memory memkind operations.
7 Note: This is EXPERIMENTAL API. The functionality and the header file
8 itself can be changed (including non-backward compatible changes) or
9 removed.
10
12 int memkind_pmem_create(struct memkind *kind, struct memkind_ops *ops,
13 const char *name);
14 int memkind_pmem_destroy(struct memkind *kind);
15 void *memkind_pmem_mmap(struct memkind *kind, void *addr, size_t size);
16 int memkind_pmem_get_mmap_flags(struct memkind *kind, int *flags);
17
19 The pmem memory memkind operations enable memory kinds built on memory-
20 mapped files. These support traditional volatile memory allocation in
21 a fashion similar to libvmem(3) library. It uses the mmap(2) system
22 call to create a pool of volatile memory. Such memory may have differ‐
23 ent attributes, depending on the file system containing the memory-
24 mapped files. (See also http://pmem.io/pmdk/libvmem).
25
26 The pmem memkinds are most useful when used with Direct Access storage
27 (DAX), which is memory-addressable persistent storage that supports
28 load/store access without being paged via the system page cache. A
29 Persistent Memory-aware file system is typically used to provide this
30 type of access.
31
32 The most convenient way to create pmem memkinds is to use memkind_cre‐
33 ate_pmem() or memkind_create_pmem_with_config() (see memkind(3)).
34
35 memkind_pmem_create() is an implementation of the memkind "create" op‐
36 eration for file-backed memory kinds. This allocates a space for some
37 pmem-specific metadata, then calls memkind_arena_create() (see
38 memkind_arena(3))
39
40 memkind_pmem_destroy() is an implementation of the memkind "destroy"
41 operation for file-backed memory kinds. This releases all of the re‐
42 sources allocated by memkind_pmem_create() and allows the file system
43 space to be reclaimed.
44
45 memkind_pmem_mmap() allocates the file system space for a block of size
46 bytes in the memory-mapped file associated with given kind. The addr
47 hint is ignored. The return value is the address of mapped memory re‐
48 gion or MAP_FAILED in the case of an error.
49
50 memkind_pmem_get_mmap_flags() sets flags to MAP_SHARED. See mmap(2)
51 for more information about these flags.
52
53 MEMKIND_PMEM_CHUNK_SIZE
54 The size of the PMEM chunk size.
55
57 Copyright (C) 2015 - 2020 Intel Corporation. All rights reserved.
58
60 memkind(3), memkind_arena(3), memkind_default(3), memkind_hbw(3),
61 memkind_hugetlb(3), libvmem(3), jemalloc(3), mbind(2), mmap(2)
62
63
64
65Intel Corporation 2015-04-21 MEMKIND_PMEM(3)