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       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       int memkind_pmem_validate_dir(const char *dir);
18

DESCRIPTION

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

SEE ALSO

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