Motr  M0
alloc.c File Reference
#include "lib/trace.h"
#include "be/alloc.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "lib/thread.h"
#include "lib/arith.h"
#include "lib/finject.h"
#include "ut/ut.h"
#include "be/ut/helper.h"
#include "be/op.h"
#include "be/alloc_internal.h"
Include dependency graph for alloc.c:

Go to the source code of this file.

Data Structures

struct  be_ut_alloc_thread_state
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_UT
 

Enumerations

enum  {
  BE_UT_ALLOC_SEG_SIZE = 0x40000, BE_UT_ALLOC_SIZE = 0x80, BE_UT_ALLOC_SHIFT = 13, BE_UT_ALLOC_PTR_NR = 0x20,
  BE_UT_ALLOC_NR = 0x800, BE_UT_ALLOC_MT_NR = 0x100, BE_UT_ALLOC_THR_NR = 0x4
}
 
enum  {
  BE_UT_OOM_SEG_START = 0x1900, BE_UT_OOM_SEG_STEP = 0x42, BE_UT_OOM_SEG_STEP_NR = 0x4, BE_UT_OOM_ALLOC_START = 0x1,
  BE_UT_OOM_ALLOC_STEP = 0x1, BE_UT_OOM_ALLOC_STEP_NR = 0x4
}
 

Functions

M0_INTERNAL void m0_be_ut_alloc_init_fini (void)
 
M0_INTERNAL void m0_be_ut_alloc_create_destroy (void)
 
static void be_ut_alloc_ptr_handle (struct m0_be_allocator *a, void **p, uint64_t *seed)
 
static void be_ut_alloc_thread (int index)
 
static void be_ut_alloc_mt (int nr)
 
M0_INTERNAL void m0_be_ut_alloc_multiple (void)
 
M0_INTERNAL void m0_be_ut_alloc_concurrent (void)
 
static void be_ut_alloc_credit_log (struct m0_be_allocator *a, enum m0_be_allocator_op optype, const char *optype_str, m0_bcount_t size, unsigned shift)
 
M0_INTERNAL void m0_be_ut_alloc_info (void)
 
static void be_ut_alloc_oom_case (struct m0_be_allocator *a, m0_bcount_t alloc_size)
 
M0_INTERNAL void m0_be_ut_alloc_oom (void)
 
M0_INTERNAL void m0_be_ut_alloc_spare (void)
 

Variables

static struct m0_be_ut_backend be_ut_alloc_backend
 
static struct m0_be_ut_seg be_ut_alloc_seg
 
static struct be_ut_alloc_thread_state be_ut_ts [BE_UT_ALLOC_THR_NR]
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_UT

Definition at line 23 of file alloc.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BE_UT_ALLOC_SEG_SIZE 
BE_UT_ALLOC_SIZE 
BE_UT_ALLOC_SHIFT 
BE_UT_ALLOC_PTR_NR 
BE_UT_ALLOC_NR 
BE_UT_ALLOC_MT_NR 
BE_UT_ALLOC_THR_NR 

Definition at line 40 of file alloc.c.

◆ anonymous enum

anonymous enum
Enumerator
BE_UT_OOM_SEG_START 
BE_UT_OOM_SEG_STEP 
BE_UT_OOM_SEG_STEP_NR 
BE_UT_OOM_ALLOC_START 
BE_UT_OOM_ALLOC_STEP 
BE_UT_OOM_ALLOC_STEP_NR 

Definition at line 241 of file alloc.c.

Function Documentation

◆ be_ut_alloc_credit_log()

static void be_ut_alloc_credit_log ( struct m0_be_allocator a,
enum m0_be_allocator_op  optype,
const char *  optype_str,
m0_bcount_t  size,
unsigned  shift 
)
static

Definition at line 194 of file alloc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ be_ut_alloc_mt()

static void be_ut_alloc_mt ( int  nr)
static

Definition at line 152 of file alloc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ be_ut_alloc_oom_case()

static void be_ut_alloc_oom_case ( struct m0_be_allocator a,
m0_bcount_t  alloc_size 
)
static

Definition at line 250 of file alloc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ be_ut_alloc_ptr_handle()

static void be_ut_alloc_ptr_handle ( struct m0_be_allocator a,
void **  p,
uint64_t *  seed 
)
static

Definition at line 94 of file alloc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ be_ut_alloc_thread()

static void be_ut_alloc_thread ( int  index)
static

Definition at line 129 of file alloc.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_be_ut_alloc_concurrent()

M0_INTERNAL void m0_be_ut_alloc_concurrent ( void  )

Definition at line 189 of file alloc.c.

Here is the call graph for this function:

◆ m0_be_ut_alloc_create_destroy()

M0_INTERNAL void m0_be_ut_alloc_create_destroy ( void  )

Definition at line 78 of file alloc.c.

Here is the call graph for this function:

◆ m0_be_ut_alloc_info()

M0_INTERNAL void m0_be_ut_alloc_info ( void  )

Definition at line 210 of file alloc.c.

Here is the call graph for this function:

◆ m0_be_ut_alloc_init_fini()

M0_INTERNAL void m0_be_ut_alloc_init_fini ( void  )

Definition at line 62 of file alloc.c.

Here is the call graph for this function:

◆ m0_be_ut_alloc_multiple()

M0_INTERNAL void m0_be_ut_alloc_multiple ( void  )

Definition at line 184 of file alloc.c.

Here is the call graph for this function:

◆ m0_be_ut_alloc_oom()

M0_INTERNAL void m0_be_ut_alloc_oom ( void  )

Definition at line 284 of file alloc.c.

Here is the call graph for this function:

◆ m0_be_ut_alloc_spare()

M0_INTERNAL void m0_be_ut_alloc_spare ( void  )

Definition at line 319 of file alloc.c.

Here is the call graph for this function:

Variable Documentation

◆ be_ut_alloc_backend

struct m0_be_ut_backend be_ut_alloc_backend
static

Definition at line 58 of file alloc.c.

◆ be_ut_alloc_seg

struct m0_be_ut_seg be_ut_alloc_seg
static

Definition at line 59 of file alloc.c.

◆ be_ut_ts

Definition at line 60 of file alloc.c.