summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7d7803f)
We can't reuse td->__random_state as that will impact the sequence
of offsets we generate for random IO.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
int io_u_flight_nr;
struct io_u **io_us_completed;
int io_u_completed_nr;
int io_u_flight_nr;
struct io_u **io_us_completed;
int io_u_completed_nr;
+
+ struct frand_state rand_state;
};
static int client_recv(struct thread_data *td, struct ibv_wc *wc)
};
static int client_recv(struct thread_data *td, struct ibv_wc *wc)
if (td->o.use_os_rand)
index = os_random_long(&td->random_state) % rd->rmt_nr;
else
if (td->o.use_os_rand)
index = os_random_long(&td->random_state) % rd->rmt_nr;
else
- index = __rand(&td->__random_state) % rd->rmt_nr;
+ index = __rand(&rd->rand_state) % rd->rmt_nr;
r_io_u_d->sq_wr.opcode = IBV_WR_RDMA_WRITE;
r_io_u_d->sq_wr.wr.rdma.rkey = rd->rmt_us[index].rkey;
r_io_u_d->sq_wr.wr.rdma.remote_addr = \
r_io_u_d->sq_wr.opcode = IBV_WR_RDMA_WRITE;
r_io_u_d->sq_wr.wr.rdma.rkey = rd->rmt_us[index].rkey;
r_io_u_d->sq_wr.wr.rdma.remote_addr = \
if (td->o.use_os_rand)
index = os_random_long(&td->random_state) % rd->rmt_nr;
else
if (td->o.use_os_rand)
index = os_random_long(&td->random_state) % rd->rmt_nr;
else
- index = __rand(&td->__random_state) % rd->rmt_nr;
+ index = __rand(&rd->rand_state) % rd->rmt_nr;
r_io_u_d->sq_wr.opcode = IBV_WR_RDMA_READ;
r_io_u_d->sq_wr.wr.rdma.rkey = rd->rmt_us[index].rkey;
r_io_u_d->sq_wr.wr.rdma.remote_addr = \
r_io_u_d->sq_wr.opcode = IBV_WR_RDMA_READ;
r_io_u_d->sq_wr.wr.rdma.rkey = rd->rmt_us[index].rkey;
r_io_u_d->sq_wr.wr.rdma.remote_addr = \
rd = malloc(sizeof(*rd));;
memset(rd, 0, sizeof(*rd));
rd = malloc(sizeof(*rd));;
memset(rd, 0, sizeof(*rd));
+ init_rand_seed(&rd->rand_state, GOLDEN_RATIO_PRIME);