62 while (
c->cl_dirty -
c->cl_io <
size) {
64 if (
conf->cc_shutdown)
67 M0_ASSERT(!cl_tlist_is_empty(&
c->cl_write_ext));
68 ext = cl_tlist_head(&
c->cl_write_ext);
71 cl_tlink_del_fini(ext);
93 unsigned clid =
param->ctp_client;
94 unsigned trid =
param->ctp_thread;
97 unsigned long nob = 0;
99 unsigned long long off =
conf->cc_total * trid;
105 while (nob < conf->cc_total) {
133 for (
i = 0;
i <
conf->cc_nr_clients; ++
i) {
135 for (j = 0; j <
conf->cc_nr_threads; ++j) {
137 param.ctp_thread = j;
141 for (j = 0; j <
conf->cc_inflight_max; ++j)
155 sizeof conf->cc_client[0]);
156 for (
i = 0;
i <
conf->cc_nr_clients; ++
i) {
160 cl_tlist_init(&
c->cl_write_ext);
166 c->cl_cache_free.ch_cnt_sleep.c_parent = &
conf->cc_cache_free;
167 c->cl_cache_busy.ch_cnt_sleep.c_parent = &
conf->cc_cache_busy;
170 sizeof c->cl_thread[0]);
172 sizeof c->cl_pageout[0]);
182 conf->cc_shutdown = 1;
184 for (
i = 0;
i <
conf->cc_nr_clients; ++
i) {
190 if (
c->cl_thread !=
NULL) {
191 for (j = 0; j <
conf->cc_nr_threads; ++j) {
202 if (
c->cl_pageout !=
NULL) {
203 for (j = 0; j <
conf->cc_inflight_max; ++j) {
209 cl_tlist_fini(&
c->cl_write_ext);
M0_INTERNAL void sim_thread_init(struct sim *state, struct sim_thread *thread, unsigned stacksize, sim_func_t func, void *arg)
static struct m0_config conf
M0_INTERNAL void sim_chan_fini(struct sim_chan *chan)
M0_INTERNAL void sim_free(void *ptr)
#define M0_FID_INIT(container, key)
M0_INTERNAL void sim_log(struct sim *s, enum sim_log_level level, const char *format,...)
M0_INTERNAL void client_init(struct sim *s, struct client_conf *conf)
static void client_pageout(struct sim *s, struct sim_thread *t, void *arg)
M0_INTERNAL void sim_chan_broadcast(struct sim_chan *chan)
struct m0_tl cl_write_ext
M0_INTERNAL void cnt_init(struct cnt *cnt, struct cnt *parent, const char *format,...)
M0_INTERNAL void net_rpc_process(struct sim_thread *t, struct net_conf *net, struct net_srv *srv, struct m0_stob_id *stob_id, unsigned long long offset, unsigned long count)
M0_INTERNAL void sim_chan_init(struct sim_chan *chan, char *format,...)
M0_INTERNAL void sim_thread_exit(struct sim_thread *thread)
struct m0_tlink cwe_linkage
M0_INTERNAL void sim_run(struct sim *state)
M0_TL_DEFINE(cl, static, struct client_write_ext)
M0_INTERNAL void sim_thread_fini(struct sim_thread *thread)
struct sim_thread * cl_thread
struct sim_chan cl_cache_free
static void client_write_loop(struct sim *s, struct sim_thread *t, void *arg)
static struct m0_addb2_callback c
static struct m0_thread t[8]
M0_INTERNAL void sim_timer_add(struct sim *state, sim_time_t delta, sim_call_t *cfunc, void *datum)
M0_INTERNAL void m0_stob_id_make(uint64_t container, uint64_t key, const struct m0_fid *dom_id, struct m0_stob_id *stob_id)
M0_INTERNAL void sim_sleep(struct sim_thread *thread, sim_time_t nap)
M0_INTERNAL void sim_chan_wait(struct sim_chan *chan, struct sim_thread *thread)
M0_INTERNAL unsigned long long sim_rnd(unsigned long long a, unsigned long long b)
M0_INTERNAL void * sim_alloc(size_t size)
unsigned long long cwe_offset
struct client_conf * ctp_conf
static int client_threads_start(struct sim_callout *call)
M0_INTERNAL void client_fini(struct client_conf *conf)
M0_TL_DESCR_DEFINE(cl, "client write extents", static, struct client_write_ext, cwe_linkage, cwe_magic, M0_DESIM_CLIENT_WRITE_EXT_MAGIC, M0_DESIM_CLIENT_WRITE_EXT_HEAD_MAGIC)
static struct m0_addb2_source * s
struct sim_chan cl_cache_busy
M0_INTERNAL void cnt_fini(struct cnt *cnt)