Motr  M0
locality.c File Reference
#include "lib/misc.h"
#include "lib/mutex.h"
#include "lib/errno.h"
#include "lib/assert.h"
#include "lib/locality.h"
#include "lib/finject.h"
#include "fop/fom.h"
#include "fop/fom_simple.h"
#include "reqh/reqh.h"
#include "reqh/reqh_service.h"
#include "ut/ut.h"
Include dependency graph for locality.c:

Go to the source code of this file.

Enumerations

enum  { NR = 4096, X_VALUE = 6 }
 
enum  { SEMISIMPLE_S0 = M0_FOM_PHASE_FINISH + 1, SEMISIMPLE_S1, SEMISIMPLE_S2 }
 

Functions

static void fom_simple_svc_start (void)
 
struct m0_reqhm0_ut__reqh_init (void)
 
void m0_ut__reqh_fini (void)
 
static void _cb0 (struct m0_sm_group *grp, struct m0_sm_ast *a)
 
static int simple_tick (struct m0_fom *fom, int *x, int *__unused)
 
static int tick_once (struct m0_fom *fom, int *x, int *__unused)
 
void free_func (struct m0_fom_simple *sfom)
 
static int semisimple_tick (struct m0_fom *fom, int *x, int *phase)
 
static int cat_tick (struct m0_fom *fom, void *null, int *__unused)
 
void test_locality (void)
 
static int ctor (void *area, void *cookie)
 
static int enter (struct m0_locality_chore *chore, struct m0_locality *loc, void *place)
 
static void leave (struct m0_locality_chore *chore, struct m0_locality *loc, void *place)
 
static void tick (struct m0_locality_chore *chore, struct m0_locality *loc, void *place)
 
static int nosys (struct m0_locality_chore *chore, struct m0_locality *loc, void *place)
 
void test_locality_chore (void)
 

Variables

static bool passed [NR]
 
static uint64_t core [NR]
 
static struct m0_mutex lock
 
static struct m0_semaphore sem [NR]
 
static struct m0_sm_ast ast [NR]
 
static struct m0_reqh reqh
 
static struct m0_fom_simple s [NR]
 
static struct m0_atomic64 hoarded
 
static bool free_func_called
 
static int expected
 
static struct m0_sm_state_descr semisimple_phases []
 
static struct m0_sm_conf semisimple_conf
 
static int entered
 
static int left
 
static int ticked
 
static int key0
 
static int key
 
static int keyother
 
static bool has0
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
NR 
X_VALUE 

Definition at line 35 of file locality.c.

◆ anonymous enum

anonymous enum
Enumerator
SEMISIMPLE_S0 
SEMISIMPLE_S1 
SEMISIMPLE_S2 

Definition at line 128 of file locality.c.

Function Documentation

◆ _cb0()

static void _cb0 ( struct m0_sm_group grp,
struct m0_sm_ast a 
)
static

Definition at line 91 of file locality.c.

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

◆ cat_tick()

static int cat_tick ( struct m0_fom fom,
void *  null,
int *  __unused 
)
static

Definition at line 191 of file locality.c.

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

◆ ctor()

static int ctor ( void *  area,
void *  cookie 
)
static

Definition at line 287 of file locality.c.

Here is the caller graph for this function:

◆ enter()

static int enter ( struct m0_locality_chore chore,
struct m0_locality loc,
void *  place 
)
static

Definition at line 294 of file locality.c.

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

◆ fom_simple_svc_start()

static void fom_simple_svc_start ( void  )
static

Definition at line 50 of file locality.c.

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

◆ free_func()

void free_func ( struct m0_fom_simple sfom)

Definition at line 122 of file locality.c.

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

◆ leave()

static void leave ( struct m0_locality_chore chore,
struct m0_locality loc,
void *  place 
)
static

Definition at line 315 of file locality.c.

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

◆ m0_ut__reqh_fini()

void m0_ut__reqh_fini ( void  )

Definition at line 84 of file locality.c.

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

◆ m0_ut__reqh_init()

struct m0_reqh* m0_ut__reqh_init ( void  )

Definition at line 67 of file locality.c.

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

◆ nosys()

static int nosys ( struct m0_locality_chore chore,
struct m0_locality loc,
void *  place 
)
static

Definition at line 336 of file locality.c.

Here is the caller graph for this function:

◆ semisimple_tick()

static int semisimple_tick ( struct m0_fom fom,
int *  x,
int *  phase 
)
static

Definition at line 164 of file locality.c.

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

◆ simple_tick()

static int simple_tick ( struct m0_fom fom,
int *  x,
int *  __unused 
)
static

Definition at line 103 of file locality.c.

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

◆ test_locality()

void test_locality ( void  )

Definition at line 204 of file locality.c.

Here is the call graph for this function:

◆ test_locality_chore()

void test_locality_chore ( void  )

Definition at line 342 of file locality.c.

Here is the call graph for this function:

◆ tick()

static void tick ( struct m0_locality_chore chore,
struct m0_locality loc,
void *  place 
)
static

Definition at line 326 of file locality.c.

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

◆ tick_once()

static int tick_once ( struct m0_fom fom,
int *  x,
int *  __unused 
)
static

Definition at line 117 of file locality.c.

Here is the caller graph for this function:

Variable Documentation

◆ ast

struct m0_sm_ast ast[NR]
static

Definition at line 44 of file locality.c.

◆ core

uint64_t core[NR]
static

Definition at line 41 of file locality.c.

◆ entered

int entered
static

Definition at line 279 of file locality.c.

◆ expected

int expected
static

Definition at line 102 of file locality.c.

◆ free_func_called

bool free_func_called
static

Definition at line 48 of file locality.c.

◆ has0

bool has0
static

Definition at line 285 of file locality.c.

◆ hoarded

struct m0_atomic64 hoarded
static

Definition at line 47 of file locality.c.

◆ key

int key
static

Definition at line 283 of file locality.c.

◆ key0

int key0
static

Definition at line 282 of file locality.c.

◆ keyother

int keyother
static

Definition at line 284 of file locality.c.

◆ left

int left
static

Definition at line 280 of file locality.c.

◆ lock

struct m0_mutex lock
static

Definition at line 42 of file locality.c.

◆ passed

bool passed[NR]
static

Definition at line 40 of file locality.c.

◆ reqh

struct m0_reqh reqh
static

Definition at line 45 of file locality.c.

◆ s

struct m0_fom_simple s[NR]
static

Definition at line 46 of file locality.c.

◆ sem

struct m0_semaphore sem[NR]
static

Definition at line 43 of file locality.c.

◆ semisimple_conf

struct m0_sm_conf semisimple_conf
static
Initial value:
= {
.scf_name = "semisimple fom",
.scf_nr_states = ARRAY_SIZE(semisimple_phases),
.scf_state = semisimple_phases
}
static struct m0_sm_state_descr semisimple_phases[]
Definition: locality.c:134
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 158 of file locality.c.

◆ semisimple_phases

struct m0_sm_state_descr semisimple_phases[]
static
Initial value:
= {
.sd_name = "init",
.sd_allowed = M0_BITS(SEMISIMPLE_S0),
.sd_flags = M0_SDF_INITIAL
},
.sd_name = "ss0",
.sd_allowed = M0_BITS(SEMISIMPLE_S1)
},
.sd_name = "ss1",
},
.sd_name = "ss2",
},
.sd_name = "done",
.sd_flags = M0_SDF_TERMINAL
}
}
#define M0_BITS(...)
Definition: misc.h:236

Definition at line 134 of file locality.c.

◆ ticked

int ticked
static

Definition at line 281 of file locality.c.