Motr  M0
alloc.h File Reference
#include "lib/types.h"
#include "lib/mutex.h"
Include dependency graph for alloc.h:

Go to the source code of this file.

Data Structures

struct  m0_be_allocator_call_stat
 
struct  m0_be_allocator_call_stats
 
struct  m0_be_alloc_zone_stats
 
struct  m0_be_allocator_stats
 Allocator statistics. More...
 
struct  m0_be_allocator
 Allocator. More...
 

Macros

#define __MOTR_BE_ALLOC_H__
 
#define M0_BE_ALLOC_ARR(arr, nr, seg, tx, op)
 
#define M0_BE_ALLOC_PTR(ptr, seg, tx, op)   M0_BE_ALLOC_ARR((ptr), 1, (seg), (tx), (op))
 
#define M0_BE_ALLOC_ARR_SYNC(arr, nr, seg, tx)
 
#define M0_BE_ALLOC_PTR_SYNC(ptr, seg, tx)   M0_BE_OP_SYNC(__op, M0_BE_ALLOC_PTR((ptr), (seg), (tx), &__op))
 
#define M0_BE_FREE_PTR(ptr, seg, tx, op)   m0_be_free(m0_be_seg_allocator(seg), (tx), (op), (ptr))
 
#define M0_BE_FREE_PTR_SYNC(ptr, seg, tx)   M0_BE_OP_SYNC(__op, M0_BE_FREE_PTR((ptr), (seg), (tx), &__op))
 
#define M0_BE_ALLOC_BUF(buf, seg, tx, op)
 
#define M0_BE_ALLOC_BUF_SYNC(buf, seg, tx)   M0_BE_OP_SYNC(__op, M0_BE_ALLOC_BUF((buf), (seg), (tx), &__op))
 
#define M0_BE_ALLOC_CREDIT_PTR(ptr, seg, accum)
 
#define M0_BE_FREE_CREDIT_PTR(ptr, seg, accum)
 
#define M0_BE_ALLOC_CREDIT_ARR(arr, nr, seg, accum)
 
#define M0_BE_FREE_CREDIT_ARR(arr, nr, seg, accum)
 
#define M0_BE_ALLOC_CREDIT_BUF(buf, seg, accum)
 

Enumerations

enum  { M0_BE_ALLOC_SHIFT_MIN = 3 }
 
enum  { M0_BE_ALLOCATOR_STATS_BOUNDARY = 1024, M0_BE_ALLOCATOR_STATS_PRINT_INTERVAL = 100 }
 
enum  m0_be_alloc_zone_type { M0_BAP_REPAIR, M0_BAP_NORMAL, M0_BAP_NR }
 
enum  m0_be_allocator_op {
  M0_BAO_CREATE, M0_BAO_DESTROY, M0_BAO_ALLOC, M0_BAO_ALLOC_ALIGNED,
  M0_BAO_FREE, M0_BAO_FREE_ALIGNED
}
 

Functions

struct m0_be_allocator_call_stat M0_XCA_DOMAIN (be)
 
uint32_t bzs_type M0_XCA_FENUM (m0_be_alloc_zone_type)
 
M0_INTERNAL int m0_be_allocator_init (struct m0_be_allocator *a, struct m0_be_seg *seg)
 
M0_INTERNAL void m0_be_allocator_fini (struct m0_be_allocator *a)
 
M0_INTERNAL bool m0_be_allocator__invariant (struct m0_be_allocator *a)
 
M0_INTERNAL int m0_be_allocator_create (struct m0_be_allocator *a, struct m0_be_tx *tx, uint32_t *zone_percent, uint32_t zones_nr)
 
M0_INTERNAL void m0_be_allocator_destroy (struct m0_be_allocator *a, struct m0_be_tx *tx)
 
M0_INTERNAL void m0_be_allocator_credit (struct m0_be_allocator *a, enum m0_be_allocator_op optype, m0_bcount_t size, unsigned shift, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_be_alloc_aligned (struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void **ptr, m0_bcount_t size, unsigned shift, uint64_t zonemask)
 
M0_INTERNAL void m0_be_alloc (struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void **ptr, m0_bcount_t size)
 
M0_INTERNAL void m0_be_free_aligned (struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void *ptr)
 
M0_INTERNAL void m0_be_free (struct m0_be_allocator *a, struct m0_be_tx *tx, struct m0_be_op *op, void *ptr)
 
M0_INTERNAL void m0_be_alloc_stats (struct m0_be_allocator *a, struct m0_be_allocator_stats *out)
 
M0_INTERNAL void m0_be_alloc_stats_credit (struct m0_be_allocator *a, struct m0_be_tx_credit *accum)
 
M0_INTERNAL void m0_be_alloc_stats_capture (struct m0_be_allocator *a, struct m0_be_tx *tx)
 

Variables

unsigned long bcs_nr
 
m0_bcount_t bcs_size
 
struct m0_be_allocator_call_stat bacs_alloc_success
 
struct m0_be_allocator_call_stat bacs_alloc_failure
 
struct m0_be_allocator_call_stat bacs_free
 
enum { ... }  M0_XCA_DOMAIN
 
enum m0_be_alloc_zone_type M0_XCA_ENUM
 
m0_bcount_t bzs_total
 
m0_bcount_t bzs_used
 
m0_bcount_t bzs_free
 
struct m0_be_allocator_call_stats bzs_stats
 
m0_bcount_t bas_chunk_overhead
 
m0_bcount_t bas_space_total
 
m0_bcount_t bas_space_used
 
m0_bcount_t bas_space_free
 
m0_bcount_t bas_stat0_boundary
 
m0_bcount_t bas_chunks_nr
 
m0_bcount_t bas_free_chunks_nr
 
struct m0_be_allocator_call_stats bas_total
 
struct m0_be_allocator_call_stats bas_stat0
 
struct m0_be_allocator_call_stats bas_stat1
 
unsigned long bas_print_interval
 
unsigned long bas_print_index
 

Macro Definition Documentation

◆ __MOTR_BE_ALLOC_H__

#define __MOTR_BE_ALLOC_H__

Definition at line 25 of file alloc.h.

Function Documentation

◆ M0_XCA_FENUM()

uint32_t bzs_type M0_XCA_DOMAIN::M0_XCA_FENUM ( m0_be_alloc_zone_type  )

Variable Documentation

◆ bacs_alloc_failure

struct m0_be_allocator_call_stat bacs_alloc_failure

Definition at line 1177 of file alloc.h.

◆ bacs_alloc_success

struct m0_be_allocator_call_stat bacs_alloc_success

Definition at line 1176 of file alloc.h.

◆ bacs_free

struct m0_be_allocator_call_stat bacs_free

Definition at line 1178 of file alloc.h.

◆ bas_chunk_overhead

m0_bcount_t bas_chunk_overhead

Definition at line 1176 of file alloc.h.

◆ bas_chunks_nr

m0_bcount_t bas_chunks_nr

Definition at line 1181 of file alloc.h.

◆ bas_free_chunks_nr

m0_bcount_t bas_free_chunks_nr

Definition at line 1182 of file alloc.h.

◆ bas_print_index

unsigned long bas_print_index

Definition at line 1187 of file alloc.h.

◆ bas_print_interval

unsigned long bas_print_interval

Definition at line 1186 of file alloc.h.

◆ bas_space_free

m0_bcount_t bas_space_free

Definition at line 1179 of file alloc.h.

◆ bas_space_total

m0_bcount_t bas_space_total

Definition at line 1177 of file alloc.h.

◆ bas_space_used

m0_bcount_t bas_space_used

Definition at line 1178 of file alloc.h.

◆ bas_stat0

struct m0_be_allocator_call_stats bas_stat0

Definition at line 1184 of file alloc.h.

◆ bas_stat0_boundary

m0_bcount_t bas_stat0_boundary

Definition at line 1180 of file alloc.h.

◆ bas_stat1

struct m0_be_allocator_call_stats bas_stat1

Definition at line 1185 of file alloc.h.

◆ bas_total

struct m0_be_allocator_call_stats bas_total

Definition at line 1183 of file alloc.h.

◆ bcs_nr

unsigned long bcs_nr

Definition at line 1176 of file alloc.h.

◆ bcs_size

m0_bcount_t bcs_size

Definition at line 1177 of file alloc.h.

◆ bzs_free

m0_bcount_t bzs_free

Definition at line 1178 of file alloc.h.

◆ bzs_stats

struct m0_be_allocator_call_stats bzs_stats

Definition at line 1181 of file alloc.h.

◆ bzs_total

m0_bcount_t bzs_total

Definition at line 1176 of file alloc.h.

◆ bzs_used

m0_bcount_t bzs_used

Definition at line 1177 of file alloc.h.