1MEMKIND_PMEM(3)                  MEMKIND_PMEM                  MEMKIND_PMEM(3)
2
3
4

NAME

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

SYNOPSIS

12       #include <memkind/internal/memkind_pmem.h>
13
14       Link with -lmemkind
15
16       int memkind_pmem_create(struct memkind *kind, struct memkind_ops *ops, const char *name);
17       int memkind_pmem_destroy(struct memkind *kind);
18       void *memkind_pmem_mmap(struct memkind *kind, void *addr, size_t size);
19       int memkind_pmem_get_mmap_flags(struct memkind *kind, int *flags);
20

DESCRIPTION

22       The pmem memory memkind operations enable memory kinds built on memory-
23       mapped files.  These support traditional volatile memory allocation  in
24       a  fashion  similar  to libvmem(3) library.  It uses the mmap(2) system
25       call to create a pool of volatile memory.  Such memory may have differ‐
26       ent  attributes,  depending  on  the file system containing the memory-
27       mapped files.  (See also http://pmem.io/pmdk/libvmem).
28
29       The pmem memkinds are most useful when used with Direct Access  storage
30       (DAX),  which  is  memory-addressable  persistent storage that supports
31       load/store access without being paged via the  system  page  cache.   A
32       Persistent  Memory-aware  file system is typically used to provide this
33       type of access.
34
35       The most convenient way to create pmem memkinds is to use  memkind_cre‐
36       ate_pmem() or memkind_create_pmem_with_config() (see memkind(3)).
37
38       memkind_pmem_create()  is  an  implementation  of  the memkind "create"
39       operation for file-backed memory kinds.  This  allocates  a  space  for
40       some  pmem-specific  metadata,  then  calls memkind_arena_create() (see
41       memkind_arena(3))
42
43       memkind_pmem_destroy() is an implementation of  the  memkind  "destroy"
44       operation  for  file-backed  memory  kinds.   This  releases all of the
45       resources allocated by memkind_pmem_create() and allows the file system
46       space to be reclaimed.
47
48       memkind_pmem_mmap() allocates the file system space for a block of size
49       bytes in the memory-mapped file associated with given kind.   The  addr
50       hint  is  ignored.   The  return  value is the address of mapped memory
51       region or MAP_FAILED in the case of an error.
52
53       memkind_pmem_get_mmap_flags() sets flags to  MAP_SHARED.   See  mmap(2)
54       for more information about these flags.
55
56       MEMKIND_PMEM_CHUNK_SIZE
57              The size of the PMEM chunk size.
58
60       Copyright (C) 2015 - 2019 Intel Corporation. All rights reserved.
61

SEE ALSO

63       memkind(3),   memkind_arena(3),   memkind_default(3),   memkind_hbw(3),
64       memkind_hugetlb(3), libvmem(3), jemalloc(3), mbind(2), mmap(2)
65
66
67
68Intel Corporation                 2015-04-21                   MEMKIND_PMEM(3)
Impressum