[PVFS2-CVS]
commit by neill in pvfs2/src/client/sysint: client-state-machine.h
sys-io.sm
CVS commit program
cvs at parl.clemson.edu
Tue Jul 13 12:29:05 EDT 2004
Update of /projects/cvsroot/pvfs2/src/client/sysint
In directory parlweb:/tmp/cvs-serv23203/src/client/sysint
Modified Files:
client-state-machine.h sys-io.sm
Log Message:
- introduce a scaling flow timeout for large I/O operations
- modify the write_ack timeout to be a bit longer than the computed
flow timeout
Index: client-state-machine.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/client-state-machine.h,v
diff -p -u -r1.120 -r1.121
--- client-state-machine.h 13 Jul 2004 02:14:18 -0000 1.120
+++ client-state-machine.h 13 Jul 2004 15:29:05 -0000 1.121
@@ -136,6 +136,7 @@ typedef struct
/* a reference to the msgpair we're using for communication */
PINT_sm_msgpair_state *msg;
+ int flow_timeout;
job_id_t flow_job_id;
job_status_s flow_status;
flow_descriptor flow_desc;
Index: sys-io.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-io.sm,v
diff -p -u -r1.84 -r1.85
--- sys-io.sm 13 Jul 2004 02:14:18 -0000 1.84
+++ sys-io.sm 13 Jul 2004 15:29:05 -0000 1.85
@@ -57,6 +57,8 @@ static inline int process_context_recv_a
static inline int check_context_status(
PINT_client_io_ctx *cur_ctx, int io_type,
PVFS_size *total_size);
+static inline int compute_scaling_flow_timeout(
+ PVFS_size data_size, int datafile_count);
static int io_find_target_datafiles(
PVFS_Request mem_req, PVFS_Request file_req,
PVFS_offset file_req_offset, PINT_dist *dist_p,
@@ -1205,20 +1207,25 @@ static inline int build_context_flow(
cur_ctx->flow_desc.file_data.fsize = resp->u.io.bstream_size;
cur_ctx->flow_desc.file_data.dist = attr->u.meta.dist;
cur_ctx->flow_desc.file_data.server_nr = cur_ctx->server_nr;
- cur_ctx->flow_desc.file_data.server_ct = attr->u.meta.dfile_count;
+ cur_ctx->flow_desc.file_data.server_ct = sm_p->u.io.datafile_count;
cur_ctx->flow_desc.file_req = sm_p->u.io.file_req;
cur_ctx->flow_desc.file_req_offset = sm_p->u.io.file_req_offset;
cur_ctx->flow_desc.mem_req = sm_p->u.io.mem_req;
+ cur_ctx->flow_timeout = compute_scaling_flow_timeout(
+ cur_ctx->flow_desc.file_data.fsize,
+ cur_ctx->flow_desc.file_data.server_ct);
+
gossip_debug(
GOSSIP_IO_DEBUG, " bstream_size = %Ld, datafile_nr = "
- "%d, datafile_ct = %d, file_req_off = %Ld\n",
+ "%d, datafile_ct = %d\n\tfile_req_off = %Ld (timeout=%d secs)\n",
Ld(cur_ctx->flow_desc.file_data.fsize),
cur_ctx->flow_desc.file_data.server_nr,
cur_ctx->flow_desc.file_data.server_ct,
- Ld(cur_ctx->flow_desc.file_req_offset));
+ Ld(cur_ctx->flow_desc.file_req_offset),
+ cur_ctx->flow_timeout);
cur_ctx->flow_desc.tag = cur_ctx->session_tag;
cur_ctx->flow_desc.type = sm_p->u.io.flowproto_type;
@@ -1328,6 +1335,9 @@ static inline int process_context_recv_a
/*
we're pre-posting the final write ack here, even though it's
ahead of the flow phase; reads are at the flow phase.
+
+ the timeout used here is slightly longer than the flow
+ (since this should happen sometime after the flow completes)
*/
status_user_tag = ((4 * cur_ctx->index) + IO_SM_PHASE_FINAL_ACK);
@@ -1336,7 +1346,8 @@ static inline int process_context_recv_a
cur_ctx->write_ack.max_resp_sz, cur_ctx->session_tag,
BMI_PRE_ALLOC, sm_p, status_user_tag,
&cur_ctx->write_ack.recv_status, &cur_ctx->write_ack.recv_id,
- pint_client_sm_context, PVFS2_CLIENT_JOB_TIMEOUT);
+ pint_client_sm_context,
+ (cur_ctx->flow_timeout + PVFS2_CLIENT_JOB_TIMEOUT));
if (ret < 0)
{
@@ -1355,7 +1366,7 @@ static inline int process_context_recv_a
ret = job_flow(
&cur_ctx->flow_desc, sm_p, status_user_tag,
&cur_ctx->flow_status, &cur_ctx->flow_job_id,
- pint_client_sm_context, PVFS2_CLIENT_JOB_TIMEOUT);
+ pint_client_sm_context, cur_ctx->flow_timeout);
if (ret < 0)
{
@@ -1478,6 +1489,16 @@ static inline int check_context_status(
}
}
return ret;
+}
+
+static inline int compute_scaling_flow_timeout(
+ PVFS_size data_size, int datafile_count)
+{
+ static int one_hundred_megs = (1024 * 1024 * 100);
+ int scale = ((data_size / one_hundred_megs) * datafile_count);
+
+ return (scale ? (scale * PVFS2_CLIENT_JOB_TIMEOUT) :
+ PVFS2_CLIENT_JOB_TIMEOUT);
}
/*
More information about the PVFS2-CVS
mailing list