Exemplo n.º 1
0
void __serverd_perf_make_request(serv_perf_t *serv_perf, bool read,
                                 uint64_t sector, uint64_t sector_nb)
{
    uint64_t lba_in_kbytes;
    uint64_t now_ms;
    double inter_arrival;
    double dist;
    int rw = read ? __READ : __WRITE;

    serv_perf->read = read;

    now_ms = os_gettimeofday_msec();

    lba_in_kbytes = sector / 2;
    /* add the lba in MB in the repartition */
    exaperf_repart_add_value(lba_repart[rw], lba_in_kbytes / 1024);

    serv_perf->header_submit_date = now_ms;

    inter_arrival = (double)now_ms - last_req_time[rw];
    dist = (double)sector - next_sector[rw];

    exaperf_repart_add_value(inter_arrival_repart[rw], inter_arrival);
    exaperf_repart_add_value(distance_repart[rw], dist);
    exaperf_repart_add_value(req_size_repart[rw], (sector_nb/2.));
    next_sector[rw] = sector + sector_nb;
    last_req_time[rw] = now_ms;
}
Exemplo n.º 2
0
void iscsi_target_perf_make_request(int rw, TARGET_CMD_T *cmd, double len)
{
    cmd->submit_date = os_gettimeofday_msec();
    exaperf_repart_add_value(target_req_size_repart[rw], len);

    os_thread_mutex_lock(&iodepth_mutex);
    exaperf_repart_add_value(target_iodepth[rw], iodepth);
    iodepth++;
    os_thread_mutex_unlock(&iodepth_mutex);
}
Exemplo n.º 3
0
void __rdev_perf_make_request(device_t *disk_device, header_t *req_header)
{
    uint64_t now_ms = os_gettimeofday_msec();
    uint64_t inter_arrival;
    int rw = -1;

    EXA_ASSERT(NBD_REQ_TYPE_IS_VALID(req_header->request_type));
    switch (req_header->request_type)
    {
    case NBD_REQ_TYPE_READ:
        rw = __READ;
        break;
    case NBD_REQ_TYPE_WRITE:
        rw = __WRITE;
        break;
    case NBD_REQ_TYPE_LOCK:
    case NBD_REQ_TYPE_UNLOCK:
        EXA_ASSERT(false);
        /* FIXME: formerly this case was not handled */
    }

    /* WARNING: be careful, although the first call is taken into account
     * here (for the inter-arrival time), the first exaperf log should not
     * be taken into consideration for the analysis. Max and mean value
     * are very big because of the history of the IOs. This happens even
     * if we start/stop the cluser between two experiments. */
    if (disk_device->last_req_time[rw] != 0)
    {
	inter_arrival = now_ms - disk_device->last_req_time[rw];
	exaperf_repart_add_value(disk_device->inter_arrival_repart[rw],
				 inter_arrival);
    }
    disk_device->last_req_time[rw] = now_ms;
    req_header->rdev_submit_date = now_ms;
}
Exemplo n.º 4
0
void __serverd_perf_make_request(header_t *req_header)
{
    uint64_t now_ms;
    double inter_arrival;
    double dist;
    int rw = -1;

    EXA_ASSERT(NBD_REQ_TYPE_IS_VALID(req_header->request_type));
    switch (req_header->request_type)
    {
    case NBD_REQ_TYPE_READ:
        rw = __READ;
        break;
    case NBD_REQ_TYPE_WRITE:
        rw = __WRITE;
        break;
    case NBD_REQ_TYPE_LOCK:
    case NBD_REQ_TYPE_UNLOCK:
        EXA_ASSERT(false);
        /* FIXME: formerly this case was not handled */
    }

    now_ms = os_gettimeofday_msec();

    /* FIXME how is it supposed to be of an other type here ? */
    if (req_header->type == NBD_HEADER_RH)
    {
	uint64_t lba_in_kbytes = req_header->sector / 2;
	/* add the lba in MB in the repartition */
	exaperf_repart_add_value(lba_repart[rw], lba_in_kbytes / 1024);

	req_header->header_submit_date = now_ms;

	inter_arrival = (double)now_ms - last_req_time[rw];
	dist = (double)req_header->sector - next_sector[rw];

	exaperf_repart_add_value(inter_arrival_repart[rw], inter_arrival);
	exaperf_repart_add_value(distance_repart[rw], dist);
	exaperf_repart_add_value(req_size_repart[rw],
				 (req_header->sector_nb/2.));
	next_sector[rw] = req_header->sector + req_header->sector_nb;
	last_req_time[rw] = now_ms;
    }
}
Exemplo n.º 5
0
void __rdev_perf_make_request(rdev_perfs_t *rdev_perfs, bool read, rdev_req_perf_t *req_perfs)
{
    uint64_t now_ms = os_gettimeofday_msec();
    uint64_t inter_arrival;
    int rw = read ? __READ : __WRITE;

    /* WARNING: be careful, although the first call is taken into account
     * here (for the inter-arrival time), the first exaperf log should not
     * be taken into consideration for the analysis. Max and mean value
     * are very big because of the history of the IOs. This happens even
     * if we start/stop the cluser between two experiments. */
    if (rdev_perfs->last_req_time[rw] != 0)
    {
	inter_arrival = now_ms - rdev_perfs->last_req_time[rw];
	exaperf_repart_add_value(rdev_perfs->inter_arrival_repart[rw],
				 inter_arrival);
    }
    rdev_perfs->last_req_time[rw] = now_ms;
    req_perfs->rdev_submit_date = now_ms;
    req_perfs->read = read;
}