Go to the source code of this file.
|
enum | { ST_NR_FOMS = 20000,
ST_WRITER_PERIOD = 1000,
ST_CYCLES_DEFAULT = 50,
ST_CYCLES_BYTES = ST_CYCLES_DEFAULT * 20
} |
|
enum | scenario {
SC_MEM_B,
SC_MEM_KB,
SC_MEM_MB,
SC_MUTEX,
SC_MUTEX_PER_CPU,
SC_LONG_LOCK,
SC_BLOCK,
SC_NR
} |
|
|
static void | cpu_utilize (const struct ub_fom *mach) |
|
static void | cpu_utilize_with_lock (struct ub_fom *mach, size_t lock_idx) |
|
static int | mem_tick (struct m0_fom *fom) |
|
static int | mutex_tick (struct m0_fom *fom) |
|
static int | mutex_per_cpu_tick (struct m0_fom *fom) |
|
static int | long_lock_tick (struct m0_fom *fom) |
|
static int | block_tick (struct m0_fom *fom) |
|
static size_t | mem_mask (enum scenario test) |
|
static size_t | cycles (enum scenario test) |
|
static int | dummy_service_start (struct m0_reqh_service *service) |
|
static void | dummy_service_stop (struct m0_reqh_service *service) |
|
static void | dummy_service_fini (struct m0_reqh_service *service) |
|
static int | dummy_service_allocate (struct m0_reqh_service **service, const struct m0_reqh_service_type *stype) |
|
static void | ub_fom_fini (struct m0_fom *fom) |
|
static int | ub_fom_tick (struct m0_fom *fom) |
|
static size_t | ub_fom_home_locality (const struct m0_fom *fom) |
|
static void | ub_fom_create (struct m0_fom **out, struct m0_reqh *reqh, size_t seqn, enum scenario test) |
|
static void | reqh_fom_add (struct m0_reqh *reqh, size_t seqn, enum scenario test) |
|
static void | reqh_test (struct m0_reqh *reqh, enum scenario test) |
|
| _UB_ROUND_DEFINE (ub_fom_mem_b, SC_MEM_B) |
|
| _UB_ROUND_DEFINE (ub_fom_mem_kb, SC_MEM_KB) |
|
| _UB_ROUND_DEFINE (ub_fom_mem_mb, SC_MEM_MB) |
|
| _UB_ROUND_DEFINE (ub_fom_mutex, SC_MUTEX) |
|
| _UB_ROUND_DEFINE (ub_fom_mutex_per_cpu, SC_MUTEX_PER_CPU) |
|
| _UB_ROUND_DEFINE (ub_fom_long_lock, SC_LONG_LOCK) |
|
| _UB_ROUND_DEFINE (ub_fom_block, SC_BLOCK) |
|
static int | _init (const char *opts M0_UNUSED) |
|
static void | _fini (void) |
|
◆ _UB_ROUND_DEFINE
Value:static void name(
int iter) \
{ \
} \
struct __ ##
name ## _semicolon_catcher
static struct m0_reqh g_reqh
Definition at line 393 of file ub.c.
◆ M0_TRACE_SUBSYSTEM
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_UT |
Definition at line 22 of file ub.c.
◆ anonymous enum
Benchmark presets.
Enumerator |
---|
ST_NR_FOMS | How many FOMs should a benchmark add to a request handler.
|
ST_WRITER_PERIOD | Reciprocal for the frequency of writer locks.
|
ST_CYCLES_DEFAULT | Default number of cpu_utilize() loop iterations.
|
ST_CYCLES_BYTES | The number of cpu_utilize() iterations for SC_MEM_B scenario.
|
Definition at line 43 of file ub.c.
◆ scenario
Types of benchmarks.
Enumerator |
---|
SC_MEM_B | Accessing bytes of memory.
|
SC_MEM_KB | Accessing kilobytes of memory.
|
SC_MEM_MB | Accessing megabytes of memory.
|
SC_MUTEX | Taking and releasing a mutex.
|
SC_MUTEX_PER_CPU | Taking and releasing mutexes — one mutex per locality.
|
SC_LONG_LOCK | Taking and releasing a long lock.
|
SC_BLOCK | Calling m0_fom_block_{enter,leave}().
|
SC_NR | |
Definition at line 58 of file ub.c.
◆ _fini()
static void _fini |
( |
void |
| ) |
|
|
static |
Definition at line 456 of file ub.c.
◆ _init()
static int _init |
( |
const char *opts |
M0_UNUSED | ) |
|
|
static |
Definition at line 414 of file ub.c.
◆ _UB_ROUND_DEFINE() [1/7]
_UB_ROUND_DEFINE |
( |
ub_fom_mem_b |
, |
|
|
SC_MEM_B |
|
|
) |
| |
◆ _UB_ROUND_DEFINE() [2/7]
_UB_ROUND_DEFINE |
( |
ub_fom_mem_kb |
, |
|
|
SC_MEM_KB |
|
|
) |
| |
◆ _UB_ROUND_DEFINE() [3/7]
_UB_ROUND_DEFINE |
( |
ub_fom_mem_mb |
, |
|
|
SC_MEM_MB |
|
|
) |
| |
◆ _UB_ROUND_DEFINE() [4/7]
_UB_ROUND_DEFINE |
( |
ub_fom_mutex |
, |
|
|
SC_MUTEX |
|
|
) |
| |
◆ _UB_ROUND_DEFINE() [5/7]
◆ _UB_ROUND_DEFINE() [6/7]
◆ _UB_ROUND_DEFINE() [7/7]
_UB_ROUND_DEFINE |
( |
ub_fom_block |
, |
|
|
SC_BLOCK |
|
|
) |
| |
◆ block_tick()
static int block_tick |
( |
struct m0_fom * |
fom | ) |
|
|
static |
◆ cpu_utilize()
static void cpu_utilize |
( |
const struct ub_fom * |
mach | ) |
|
|
static |
Performs raw memory operations.
Definition at line 215 of file ub.c.
◆ cpu_utilize_with_lock()
static void cpu_utilize_with_lock |
( |
struct ub_fom * |
mach, |
|
|
size_t |
lock_idx |
|
) |
| |
|
static |
Definition at line 104 of file ub.c.
◆ cycles()
static size_t cycles |
( |
enum scenario |
test | ) |
|
|
static |
Definition at line 209 of file ub.c.
◆ dummy_service_allocate()
Definition at line 283 of file ub.c.
◆ dummy_service_fini()
Definition at line 271 of file ub.c.
◆ dummy_service_start()
Definition at line 260 of file ub.c.
◆ dummy_service_stop()
Definition at line 266 of file ub.c.
◆ long_lock_tick()
static int long_lock_tick |
( |
struct m0_fom * |
fom | ) |
|
|
static |
I/O overhead: acquisition of m0_long_lock shared between localities.
Definition at line 156 of file ub.c.
◆ mem_mask()
static size_t mem_mask |
( |
enum scenario |
test | ) |
|
|
static |
Definition at line 199 of file ub.c.
◆ mem_tick()
static int mem_tick |
( |
struct m0_fom * |
fom | ) |
|
|
static |
No I/O overhead.
Definition at line 114 of file ub.c.
◆ mutex_per_cpu_tick()
static int mutex_per_cpu_tick |
( |
struct m0_fom * |
fom | ) |
|
|
static |
I/O overhead: several FOMs of one locality may contend for the same mutex.
Acquires the mutex associated with current locality and not shared with other localities. There is no concurrency with other FOMs of current locality, because a locality runs its ->fo_tick()s sequentially.
Definition at line 145 of file ub.c.
◆ mutex_tick()
static int mutex_tick |
( |
struct m0_fom * |
fom | ) |
|
|
static |
I/O overhead: acquisition of mutex shared between localities.
Definition at line 128 of file ub.c.
◆ reqh_fom_add()
static void reqh_fom_add |
( |
struct m0_reqh * |
reqh, |
|
|
size_t |
seqn, |
|
|
enum scenario |
test |
|
) |
| |
|
static |
Definition at line 368 of file ub.c.
◆ reqh_test()
Creates dummy FOMs and adds them to request handler's queue.
Definition at line 381 of file ub.c.
◆ ub_fom_create()
static void ub_fom_create |
( |
struct m0_fom ** |
out, |
|
|
struct m0_reqh * |
reqh, |
|
|
size_t |
seqn, |
|
|
enum scenario |
test |
|
) |
| |
|
static |
Definition at line 351 of file ub.c.
◆ ub_fom_fini()
static void ub_fom_fini |
( |
struct m0_fom * |
fom | ) |
|
|
static |
Definition at line 314 of file ub.c.
◆ ub_fom_home_locality()
static size_t ub_fom_home_locality |
( |
const struct m0_fom * |
fom | ) |
|
|
static |
Definition at line 331 of file ub.c.
◆ ub_fom_tick()
static int ub_fom_tick |
( |
struct m0_fom * |
fom | ) |
|
|
static |
Definition at line 323 of file ub.c.
◆ _stype_ops
Initial value:= {
}
static int dummy_service_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
Definition at line 300 of file ub.c.
◆ dummy_service_ops
Initial value:= {
}
static void dummy_service_stop(struct m0_reqh_service *service)
static int dummy_service_start(struct m0_reqh_service *service)
static void dummy_service_fini(struct m0_reqh_service *service)
Definition at line 277 of file ub.c.
◆ g_long_lock
Definition at line 40 of file ub.c.
◆ g_mem
Definition at line 37 of file ub.c.
◆ g_mutexes
Definition at line 38 of file ub.c.
◆ g_mutexes_nr
Definition at line 39 of file ub.c.
◆ g_reqh
Definition at line 34 of file ub.c.
◆ g_svc
Definition at line 35 of file ub.c.
◆ m0_fom_ub
Definition at line 474 of file ub.c.
◆ ticks
Initial value:= {
}
static int block_tick(struct m0_fom *fom)
static int long_lock_tick(struct m0_fom *fom)
static int mutex_per_cpu_tick(struct m0_fom *fom)
static int mutex_tick(struct m0_fom *fom)
static int mem_tick(struct m0_fom *fom)
Definition at line 246 of file ub.c.
◆ ub_fom_ops
Initial value:= {
}
static int ub_fom_tick(struct m0_fom *fom)
static size_t ub_fom_home_locality(const struct m0_fom *fom)
static void ub_fom_fini(struct m0_fom *fom)
Definition at line 339 of file ub.c.
◆ ub_fom_stype
Initial value:= {
.rst_name = "ub-fom-service",
}
static const struct m0_reqh_service_type_ops _stype_ops
Definition at line 304 of file ub.c.
◆ ub_fom_type
Definition at line 345 of file ub.c.
◆ ub_fom_type_ops
Initial value:
Definition at line 347 of file ub.c.