22 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_UT 37 static char g_mem[8 * (1 << 20)];
176 if (phase == REQ_LOCK)
232 switch (
mach->uf_seqn % 3) {
393 #define _UB_ROUND_DEFINE(name, test) \ 394 static void name(int iter) \ 396 reqh_test(&g_reqh, test); \ 398 struct __ ## name ## _semicolon_catcher 406 #ifndef ENABLE_PROFILER 410 #undef _UB_ROUND_DEFINE 429 .rhia_dtm = (
void *)1,
431 .rhia_mdstore = (
void *)1,
479 { .ub_name =
"mem-bytes",
481 .ub_round = ub_fom_mem_b },
482 { .ub_name =
"mem-KB",
484 .ub_round = ub_fom_mem_kb },
485 { .ub_name =
"mem-MB",
487 .ub_round = ub_fom_mem_mb },
488 { .ub_name =
"shared-mutex",
490 .ub_round = ub_fom_mutex },
491 { .ub_name =
"mutex-per-locality",
493 .ub_round = ub_fom_mutex_per_cpu },
494 { .ub_name =
"long-lock",
496 .ub_round = ub_fom_long_lock },
497 #ifndef ENABLE_PROFILER 498 { .ub_name =
"block",
500 .ub_round = ub_fom_block },
506 #undef M0_TRACE_SUBSYSTEM
M0_INTERNAL void m0_long_lock_fini(struct m0_long_lock *lock)
static struct m0_mutex lock
M0_INTERNAL void m0_long_lock_link_init(struct m0_long_lock_link *link, struct m0_fom *fom, struct m0_long_lock_addb2 *addb2)
static int ub_fom_tick(struct m0_fom *fom)
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL int m0_reqh_service_start(struct m0_reqh_service *service)
M0_INTERNAL void m0_reqh_services_terminate(struct m0_reqh *reqh)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
int(* rso_start)(struct m0_reqh_service *service)
static int dummy_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
M0_INTERNAL void m0_fom_block_enter(struct m0_fom *fom)
#define M0_FOM_LONG_LOCK_RETURN(rc)
static struct m0_addb2_mach * m
static size_t locality(const struct m0_fom *fom)
#define M0_UB_ASSERT(cond)
#define M0_REQH_INIT(reqh,...)
#define M0_LOG(level,...)
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
static struct m0_long_lock g_long_lock
static struct m0_addb2_mach * mach
static int block_tick(struct m0_fom *fom)
M0_INTERNAL void m0_long_write_unlock(struct m0_long_lock *lock, struct m0_long_lock_link *link)
#define container_of(ptr, type, member)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
M0_INTERNAL void m0_reqh_fini(struct m0_reqh *reqh)
struct m0_rwlock rh_rwlock
const struct m0_sm_conf m0_generic_conf
static void ub_fom_create(struct m0_fom **out, struct m0_reqh *reqh, size_t seqn, enum scenario test)
int m0_reqh_service_type_register(struct m0_reqh_service_type *rstype)
static void cpu_utilize_with_lock(struct ub_fom *mach, size_t lock_idx)
M0_INTERNAL void m0_reqh_shutdown_wait(struct m0_reqh *reqh)
static void dummy_service_stop(struct m0_reqh_service *service)
static void reqh_test(struct m0_reqh *reqh, enum scenario test)
static size_t cycles(enum scenario test)
void m0_fom_init(struct m0_fom *fom, const struct m0_fom_type *fom_type, const struct m0_fom_ops *ops, struct m0_fop *fop, struct m0_fop *reply, struct m0_reqh *reqh)
M0_INTERNAL bool m0_long_write_lock(struct m0_long_lock *lk, struct m0_long_lock_link *link, int next_phase)
static void cpu_utilize(const struct ub_fom *mach)
static const struct socktype stype[]
struct m0_ub_set m0_fom_ub
static int long_lock_tick(struct m0_fom *fom)
void m0_fom_fini(struct m0_fom *fom)
static const struct m0_fom_type_ops ub_fom_type_ops
static int(* ticks[SC_NR])(struct m0_fom *fom)
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
M0_INTERNAL void m0_long_lock_link_fini(struct m0_long_lock_link *link)
static int mutex_per_cpu_tick(struct m0_fom *fom)
M0_INTERNAL void m0_fom_type_init(struct m0_fom_type *type, uint64_t id, const struct m0_fom_type_ops *ops, const struct m0_reqh_service_type *svc_type, const struct m0_sm_conf *sm)
M0_INTERNAL void m0_fom_block_leave(struct m0_fom *fom)
static int mutex_tick(struct m0_fom *fom)
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
M0_INTERNAL uint64_t m0_reqh_nr_localities(const struct m0_reqh *reqh)
M0_INTERNAL int m0_reqh_service_allocate(struct m0_reqh_service **out, const struct m0_reqh_service_type *stype, struct m0_reqh_context *rctx)
M0_INTERNAL void m0_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
M0_INTERNAL void m0_reqh_idle_wait(struct m0_reqh *reqh)
static void reqh_fom_add(struct m0_reqh *reqh, size_t seqn, enum scenario test)
static int dummy_service_start(struct m0_reqh_service *service)
static struct m0_mutex * g_mutexes
M0_INTERNAL int m0_reqh_state_get(struct m0_reqh *reqh)
M0_INTERNAL void m0_long_lock_init(struct m0_long_lock *lock)
static struct m0_reqh_service * g_svc
M0_INTERNAL void m0_reqh_start(struct m0_reqh *reqh)
static size_t mem_mask(enum scenario test)
static size_t ub_fom_home_locality(const struct m0_fom *fom)
int(* rsto_service_allocate)(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
#define _UB_ROUND_DEFINE(name, test)
static struct m0_reqh g_reqh
#define M0_ALLOC_PTR(ptr)
static struct m0_fom_type ub_fom_type
static const struct m0_reqh_service_type_ops _stype_ops
static struct m0_net_test_service svc
static int _init(const char *opts M0_UNUSED)
static int start(struct m0_fom *fom)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
M0_INTERNAL void m0_rwlock_read_lock(struct m0_rwlock *lock)
#define IS_IN_ARRAY(idx, array)
M0_INTERNAL void m0_fom_queue(struct m0_fom *fom)
static char g_mem[8 *(1<< 20)]
void(* fo_fini)(struct m0_fom *fom)
M0_INTERNAL void m0_rwlock_read_unlock(struct m0_rwlock *lock)
M0_INTERNAL void m0_long_read_unlock(struct m0_long_lock *lock, struct m0_long_lock_link *link)
M0_INTERNAL bool m0_long_read_lock(struct m0_long_lock *lk, struct m0_long_lock_link *link, int next_phase)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
static size_t g_mutexes_nr
struct m0_long_lock_link uf_link
static void dummy_service_fini(struct m0_reqh_service *service)
void m0_reqh_service_type_unregister(struct m0_reqh_service_type *rstype)
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
static const struct m0_fom_ops ub_fom_ops
struct m0_fid g_process_fid
static void unlock(struct m0_long_lock *lock, struct m0_long_lock_link *link, bool check_ownership)
struct m0_reqh_service_type ub_fom_stype
static int mem_tick(struct m0_fom *fom)
static void ub_fom_fini(struct m0_fom *fom)
static const struct m0_reqh_service_ops dummy_service_ops