[Pvfs2-cvs] commit by kunkel in pvfs2/src/server: prelude.sm
perf-update.sm pvfs2-server.c io.sm final-response.sm perf-mon.sm
CVS commit program
cvs at parl.clemson.edu
Tue Feb 27 16:38:39 EST 2007
Update of /projects/cvsroot/pvfs2/src/server
In directory parlweb1:/tmp/cvs-serv1757/src/server
Modified Files:
Tag: kunkel-hint-branch
prelude.sm perf-update.sm pvfs2-server.c io.sm
final-response.sm perf-mon.sm
Log Message:
Cleanup of performance counter code...
Index: prelude.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/prelude.sm,v
diff -p -u -r1.61.2.2 -r1.61.2.3
--- prelude.sm 25 Sep 2006 15:28:38 -0000 1.61.2.2
+++ prelude.sm 27 Feb 2007 21:38:39 -0000 1.61.2.3
@@ -1,5 +1,5 @@
-/*
- * (C) 2001 Clemson University and The University of Chicago
+/*
+ * (C) 2001 Clemson University and The University of Chicago
*
* See COPYING in top-level directory.
*/
@@ -17,7 +17,7 @@
#include "pint-perf-counter.h"
/* prelude state machine:
- * This is a nested state machine that performs initial setup
+ * This is a nested state machine that performs initial setup
* steps that are common to many server operations.
* - post the request to the request scheduler
* - check permissions
@@ -111,11 +111,10 @@ static int prelude_req_sched(
{
s_op->resp.u.mgmt_setparam.old_value = PINT_req_sched_get_mode();
}
-
+
ret = job_req_sched_post(s_op->req, 0, s_op, 0, js_p,
&(s_op->scheduled_id), server_job_context);
- PINT_perf_count(PINT_server_pc, PINT_PERF_REQSCHED, 1, PINT_PERF_ADD);
return ret;
}
@@ -140,7 +139,7 @@ static int prelude_getattr_if_needed(
* what handle this request will operate on
*/
ret = PINT_req_sched_target_handle(
- s_op->req, 0, &s_op->target_handle,
+ s_op->req, 0, &s_op->target_handle,
&s_op->target_fs_id, &readonly_flag);
if (ret < 0)
@@ -336,7 +335,7 @@ static int iterate_root_squash_wildcards
{
gossip_debug(GOSSIP_SERVER_DEBUG, "BMI_query_addr_range %lld, %s\n",
lld(client_addr), fsconfig->root_squash_hosts[i]);
- if (BMI_query_addr_range(client_addr, fsconfig->root_squash_hosts[i],
+ if (BMI_query_addr_range(client_addr, fsconfig->root_squash_hosts[i],
fsconfig->root_squash_netmasks[i]) == 1)
{
return 1;
@@ -346,7 +345,7 @@ static int iterate_root_squash_wildcards
}
/* Translate_ids will return 1 if it did some uid/gid squashing, 0 otherwise */
-static int translate_ids(PVFS_fs_id fsid, PVFS_uid uid, PVFS_gid gid,
+static int translate_ids(PVFS_fs_id fsid, PVFS_uid uid, PVFS_gid gid,
PVFS_uid *translated_uid, PVFS_gid *translated_gid, PVFS_BMI_addr_t client_addr)
{
int exp_flags = 0;
@@ -413,8 +412,8 @@ static int iterate_ro_wildcards(struct f
}
static int permit_operation(PVFS_fs_id fsid, int read_only, PVFS_BMI_addr_t client_addr)
-{
- int exp_flags = 0;
+{
+ int exp_flags = 0;
struct server_configuration_s *serv_config = NULL;
struct filesystem_configuration_s * fsconfig = NULL;
@@ -441,7 +440,7 @@ static int permit_operation(PVFS_fs_id f
*/
if (iterate_ro_wildcards(fsconfig, client_addr) == 1)
{
- gossip_debug(GOSSIP_SERVER_DEBUG,
+ gossip_debug(GOSSIP_SERVER_DEBUG,
"Disallowing read-write operation on a read-only exported file-system\n");
return -EROFS;
}
@@ -510,7 +509,7 @@ static int prelude_perm_check(
js_p->error_code = -PVFS_EROFS;
return 1;
}
- else
+ else
{
/* Translate the uid and gid's in case we need to do some squashing based on the export and the client address */
if (translate_ids(fsid, s_op->req->credentials.uid, s_op->req->credentials.gid,
@@ -550,7 +549,7 @@ static int prelude_perm_check(
s_op->attr.owner, translated_uid,
((s_op->attr.mask & PVFS_ATTR_COMMON_GID) ? "yes" : "no"),
s_op->attr.group, translated_gid);
-
+
switch(PINT_server_req_table[s_op->req->op].perm)
{
case PINT_SERVER_CHECK_WRITE:
@@ -630,7 +629,7 @@ static int prelude_perm_check(
"error code to %d\n", PINT_map_server_op_to_string(s_op->req->op),
js_p->error_code);
- gossip_debug(GOSSIP_SERVER_DEBUG,
+ gossip_debug(GOSSIP_SERVER_DEBUG,
"(%p) %s (prelude sm) state: perm_check (status = %d)\n",
s_op,
PINT_map_server_op_to_string(s_op->req->op),
@@ -653,7 +652,7 @@ static int prelude_check_acls_if_needed(
PINT_map_server_op_to_string(s_op->req->op));
/* If we get here with an invalid fsid and handle, we have to
- * return -PVFS_EACCESS
+ * return -PVFS_EACCESS
*/
if (s_op->target_fs_id == PVFS_FS_ID_NULL
|| s_op->target_handle == PVFS_HANDLE_NULL)
@@ -740,7 +739,7 @@ static int prelude_check_acls(
}
js_p->error_code = PINT_check_acls(s_op->val.buffer,
s_op->val.read_sz,
- obj_attr,
+ obj_attr,
s_op->req->credentials.uid,
s_op->req->credentials.gid,
want);
@@ -751,7 +750,7 @@ cleanup:
PINT_map_server_op_to_string(s_op->req->op),
js_p->error_code, want);
- if (s_op->val.buffer)
+ if (s_op->val.buffer)
free(s_op->val.buffer);
memset(&s_op->key, 0, sizeof(PVFS_ds_keyval));
memset(&s_op->val, 0, sizeof(PVFS_ds_keyval));
Index: perf-update.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/perf-update.sm,v
diff -p -u -r1.8.8.3 -r1.8.8.4
--- perf-update.sm 15 Dec 2006 13:40:36 -0000 1.8.8.3
+++ perf-update.sm 27 Feb 2007 21:38:39 -0000 1.8.8.4
@@ -1,5 +1,5 @@
-/*
- * (C) 2001 Clemson University and The University of Chicago
+/*
+ * (C) 2001 Clemson University and The University of Chicago
*
* See COPYING in top-level directory.
*/
@@ -26,14 +26,14 @@ static int perf_update_error(PINT_server
machine pvfs2_perf_update_sm(do_work, error)
{
- state do_work
+ state do_work
{
run perf_update_do_work;
success => do_work;
default => error;
}
- state error
+ state error
{
run perf_update_error;
default => terminate;
@@ -68,13 +68,16 @@ static int perf_update_do_work(PINT_serv
uint64_t current_mask = 0;
int current_debug_on = 0;
struct server_configuration_s *user_opts = get_server_config_struct();
-
+
static struct sstat * cursstat;
static struct sstat * presstat; /* preserve values */
static int first_run = 1;
-
+
struct sstat devsstat;
+ /* roll over to next set of statistics */
+ PINT_perf_rollover(PINT_server_pc);
+
#if 0
PINT_STATE_DEBUG("do_work");
#endif
@@ -85,24 +88,26 @@ static int perf_update_do_work(PINT_serv
{
cursstat = malloc(sizeof(struct sstat));
presstat = malloc(sizeof(struct sstat));
-
- photosyst(cursstat);
+
+ photosyst(cursstat);
}
else
- {
+ {
static struct sstat * tmpstat;
tmpstat = cursstat;
cursstat = presstat;
presstat = tmpstat;
-
+
photosyst(cursstat);
deviatsyst(cursstat, presstat, &devsstat);
}
-
+
if (! first_run)
{
for(i=0; i<PINT_server_pc->key_count; i++)
{
+ int j;
+ uint64_t total = 0;
switch(PINT_server_pc->key_array[i].key){
case(PINT_PERF_LOAD):{
/* get the current load */
@@ -111,107 +116,82 @@ static int perf_update_do_work(PINT_serv
memset(&system_metrics, 0, sizeof(struct sysinfo));
if (sysinfo(&system_metrics) == 0)
{
- PINT_server_pc->value_matrix[i][0] = system_metrics.loads[0];
+ total = system_metrics.loads[0];
}
-#endif
+#endif
break;
}
case(PINT_PERF_CPU):{
- PINT_server_pc->value_matrix[i][0] = devsstat.cpu.all.itime;
+ /* do not include wait_time and idle_time */
+ total = devsstat.cpu.all.utime + devsstat.cpu.all.stime;
break;
}
case(PINT_PERF_DISK_READ):{
- int j;
- uint64_t total = 0;
for(j=0; j < devsstat.xdsk.nrxdsk; j++)
{
total += devsstat.xdsk.xdsk[j].nrblk;
}
- PINT_server_pc->value_matrix[i][0] = total;
break;
}
case(PINT_PERF_DISK_WRITE):{
- int j;
- uint64_t total = 0;
for(j=0; j < devsstat.xdsk.nrxdsk; j++)
{
total += devsstat.xdsk.xdsk[j].nwblk;
}
- PINT_server_pc->value_matrix[i][0] = total;
break;
}
case(PINT_PERF_NETWORK_READ):{
- int j;
- uint64_t total = 0;
for(j=0; j < devsstat.intf.nrintf; j++)
{
total += devsstat.intf.intf[j].rbyte;
}
- PINT_server_pc->value_matrix[i][0] = total;
break;
}
case(PINT_PERF_NETWORK_WRITE):{
- int j;
- uint64_t total = 0;
for(j=0; j < devsstat.intf.nrintf; j++)
{
total += devsstat.intf.intf[j].sbyte;
}
- PINT_server_pc->value_matrix[i][0] = total;
break;
}
-
+ default:
+ total = PINT_server_pc->value_matrix[i][1];
}
-
+ PINT_server_pc->value_matrix[i][1] = total;
}
-
- gossip_get_debug_mask(¤t_debug_on, ¤t_mask);
- /*
- * log values to event subsystem
- */
-#if defined(HAVE_MPE)
+
+ gossip_get_debug_mask(¤t_debug_on, ¤t_mask);
+ /*
+ * log values to event subsystem
+ */
for(i=0; i < PINT_server_pc->key_count; i++){
if(current_debug_on)
{
int64_t val;
+ /* always take values from LAST interval which data is fixated */
if(PINT_server_pc->key_array[i].flag == PINT_PERF_PRESERVE){
- val = PINT_server_pc->value_matrix[i][0] -
- PINT_server_pc->value_matrix[i][1];
- }else{
- val = PINT_server_pc->value_matrix[i][0];
- }
- PINT_event_timestamp(PVFS_EVENT_API_PERFORMANCE_COUNTER, i,
- val,
- 0,0);
- }
- }
+ val = PINT_server_pc->value_matrix[i][1] -
+ PINT_server_pc->value_matrix[i][2];
+ }else{
+ val = PINT_server_pc->value_matrix[i][1];
+ }
+#if defined(HAVE_MPE)
+ PINT_event_timestamp(PVFS_EVENT_API_PERFORMANCE_COUNTER, i,
+ val, 0,0);
#endif
-
- /* log current statistics if the gossip mask permits */
- gossip_debug(GOSSIP_PERFCOUNTER_DEBUG, "Performance counter values:\n");
- if(current_mask & GOSSIP_PERFCOUNTER_DEBUG)
- {
- int64_t val;
- /* simple output for easier parsing */
- for(i=0; i < PINT_server_pc->key_count; i++){
- if(PINT_server_pc->key_array[i].flag == PINT_PERF_PRESERVE){
- val = PINT_server_pc->value_matrix[i][0] -
- PINT_server_pc->value_matrix[i][1];
- }else{
- val = PINT_server_pc->value_matrix[i][0];
- }
- fprintf(stderr, "perf-update-stat:%s val:%lld\n",
- PINT_server_pc->key_array[i].key_name,
- val);
- }
+ if(current_mask & GOSSIP_PERFCOUNTER_DEBUG)
+ {
+ fprintf(stderr, "perf-update-stat:%s val:%lld\n",
+ PINT_server_pc->key_array[i].key_name, val);
+ }
+ }
}
+
} /* end ! first_run */
-
+
first_run = 0;
-
- /* roll over to next set of statistics */
- PINT_perf_rollover(PINT_server_pc);
-
+
+
/* post another timer */
return(job_req_sched_post_timer(user_opts->perf_update_interval,
s_op,
Index: pvfs2-server.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/pvfs2-server.c,v
diff -p -u -r1.224.2.6 -r1.224.2.7
--- pvfs2-server.c 2 Dec 2006 11:20:42 -0000 1.224.2.6
+++ pvfs2-server.c 27 Feb 2007 21:38:39 -0000 1.224.2.7
@@ -74,9 +74,6 @@ static struct PINT_perf_key server_keys[
{"bytes written", PINT_PERF_WRITE, 0},
{"metadata reads", PINT_PERF_METADATA_READ, PINT_PERF_PRESERVE},
{"metadata writes", PINT_PERF_METADATA_WRITE, PINT_PERF_PRESERVE},
- {"metadata dspace ops", PINT_PERF_METADATA_DSPACE_OPS, PINT_PERF_PRESERVE},
- {"metadata keyval ops", PINT_PERF_METADATA_KEYVAL_OPS, PINT_PERF_PRESERVE},
- {"request scheduler", PINT_PERF_REQSCHED, PINT_PERF_PRESERVE},
{"load_1", PINT_PERF_LOAD, 0},
{"cpu usage", PINT_PERF_CPU, 0},
{"network read", PINT_PERF_NETWORK_READ, 0},
@@ -483,13 +480,13 @@ int main(int argc, char **argv)
}
else
{
- server_conf = ((argc >= (optind + 1)) ? argv[optind + 1] : NULL);
+ server_conf = ((argc >= (optind + 1)) ? argv[optind + 1] : NULL);
}
ret = PINT_parse_config(&server_config, fs_conf, server_conf);
if (ret < 0)
{
- gossip_err("Error: Please check your config files.\n");
+ gossip_err("Error: Please check your config files.\n");
gossip_err("Error: Server aborting.\n");
goto server_shutdown;
}
@@ -593,7 +590,7 @@ int main(int argc, char **argv)
goto server_shutdown;
}
#endif
-
+
/* kick off timer for expired jobs */
ret = server_state_machine_alloc_noreq(
PVFS_SERV_JOB_TIMER, &(tmp_op));
@@ -609,7 +606,7 @@ int main(int argc, char **argv)
}
/* Initialization complete; process server requests indefinitely. */
- for ( ;; )
+ for ( ;; )
{
int i, comp_ct = PVFS_SERVER_TEST_COUNT;
@@ -620,7 +617,7 @@ int main(int argc, char **argv)
{
/*
* If we received a signal, then find out if we can exit now
- * by checking if all s_ops (for expected messages) have either
+ * by checking if all s_ops (for expected messages) have either
* finished or timed out,
*/
if (qlist_empty(&inprogress_sop_list))
@@ -669,7 +666,7 @@ int main(int argc, char **argv)
PVFS_perror_gossip("Error: server_state_machine_start", ret);
/* TODO: tell BMI to drop this address? */
/* set return code to zero to allow server to continue
- * processing
+ * processing
*/
ret = 0;
}
@@ -775,10 +772,10 @@ static int server_initialize(
PINT_server_status_flag *server_status_flag,
job_status_s *job_status_structs)
{
- int ret = 0, i = 0;
+ int ret = 0, i = 0;
FILE *dummy;
uint64_t debug_mask = 0;
-
+
assert(server_config.logfile != NULL);
dummy = fopen(server_config.logfile, "a");
if (dummy == NULL)
@@ -985,7 +982,7 @@ static int server_initialize_subsystems(
bmi_flags |= BMI_TCP_BIND_SPECIFIC;
}
- ret = BMI_initialize(server_config.bmi_modules,
+ ret = BMI_initialize(server_config.bmi_modules,
server_config.host_id,
bmi_flags);
if (ret < 0)
@@ -1030,13 +1027,13 @@ static int server_initialize_subsystems(
}
/* Set the buffer size according to configuration file */
- BMI_set_info(0, BMI_TCP_BUFFER_SEND_SIZE,
+ BMI_set_info(0, BMI_TCP_BUFFER_SEND_SIZE,
(void *)&server_config.tcp_buffer_size_send);
- BMI_set_info(0, BMI_TCP_BUFFER_RECEIVE_SIZE,
+ BMI_set_info(0, BMI_TCP_BUFFER_RECEIVE_SIZE,
(void *)&server_config.tcp_buffer_size_receive);
ret = trove_initialize(
- server_config.trove_method,
+ server_config.trove_method,
trove_coll_to_method_callback,
server_config.storage_path,
init_flags);
@@ -1157,7 +1154,7 @@ static int server_initialize_subsystems(
complain in logging and continue.
*/
ret = trove_collection_setinfo(
- cur_fs->coll_id, trove_context,
+ cur_fs->coll_id, trove_context,
TROVE_COLLECTION_HANDLE_TIMEOUT,
(void *)&cur_fs->handle_recycle_timeout_sec);
if (ret < 0)
@@ -1170,7 +1167,7 @@ static int server_initialize_subsystems(
cur_fs->attr_cache_max_num_elems)
{
ret = trove_collection_setinfo(
- cur_fs->coll_id, trove_context,
+ cur_fs->coll_id, trove_context,
TROVE_COLLECTION_ATTR_CACHE_KEYWORDS,
(void *)cur_fs->attr_cache_keywords);
if (ret < 0)
@@ -1178,7 +1175,7 @@ static int server_initialize_subsystems(
gossip_lerr("Error setting attr cache keywords\n");
}
ret = trove_collection_setinfo(
- cur_fs->coll_id, trove_context,
+ cur_fs->coll_id, trove_context,
TROVE_COLLECTION_ATTR_CACHE_SIZE,
(void *)&cur_fs->attr_cache_size);
if (ret < 0)
@@ -1186,7 +1183,7 @@ static int server_initialize_subsystems(
gossip_lerr("Error setting attr cache size\n");
}
ret = trove_collection_setinfo(
- cur_fs->coll_id, trove_context,
+ cur_fs->coll_id, trove_context,
TROVE_COLLECTION_ATTR_CACHE_MAX_NUM_ELEMS,
(void *)&cur_fs->attr_cache_max_num_elems);
if (ret < 0)
@@ -1194,7 +1191,7 @@ static int server_initialize_subsystems(
gossip_lerr("Error setting attr cache max num elems\n");
}
ret = trove_collection_setinfo(
- cur_fs->coll_id, trove_context,
+ cur_fs->coll_id, trove_context,
TROVE_COLLECTION_ATTR_CACHE_INITIALIZE,
(void *)0);
if (ret < 0)
@@ -1241,7 +1238,7 @@ static int server_initialize_subsystems(
gossip_lerr("Error setting coalescing low watermark\n");
return ret;
}
-
+
ret = trove_collection_setinfo(
cur_fs->coll_id, trove_context,
TROVE_COLLECTION_META_SYNC_MODE,
@@ -1250,8 +1247,8 @@ static int server_initialize_subsystems(
{
gossip_lerr("Error setting coalescing low watermark\n");
return ret;
- }
-
+ }
+
ret = trove_collection_setinfo(
cur_fs->coll_id, trove_context,
TROVE_COLLECTION_IMMEDIATE_COMPLETION,
@@ -1260,7 +1257,7 @@ static int server_initialize_subsystems(
{
gossip_lerr("Error setting trove immediate completion\n");
return ret;
- }
+ }
gossip_debug(GOSSIP_SERVER_DEBUG, "File system %s using "
"handles:\n\t%s\n", cur_fs->file_system_name,
@@ -1321,7 +1318,7 @@ static int server_initialize_subsystems(
}
*server_status_flag |= SERVER_JOB_INIT;
-
+
ret = job_open_context(&server_job_context);
if (ret < 0)
{
@@ -1350,8 +1347,8 @@ static int server_initialize_subsystems(
#endif
/* start logging if start_event is specified in the event logging list */
- ret = PINT_event_initialize(PINT_EVENT_DEFAULT_RING_SIZE,
- (server_config.event_logging[0] != 0 &&
+ ret = PINT_event_initialize(PINT_EVENT_DEFAULT_RING_SIZE,
+ (server_config.event_logging[0] != 0 &&
strstr(server_config.event_logging,"start_event_logging") != 0) );
if (ret < 0)
{
@@ -1431,8 +1428,8 @@ static void bt_sighandler(int sig, sigin
/* Do something useful with siginfo_t */
if (sig == SIGSEGV)
{
- gossip_err("PVFS2 server: signal %d, faulty address is %p, "
- "from %p\n", sig, info->si_addr,
+ gossip_err("PVFS2 server: signal %d, faulty address is %p, "
+ "from %p\n", sig, info->si_addr,
(void*)uc->uc_mcontext.gregs[REG_INSTRUCTION_POINTER]);
}
else
@@ -1502,7 +1499,7 @@ static int server_shutdown(
gossip_debug(GOSSIP_SERVER_DEBUG, "[-] request "
"scheduler [ stopped ]\n");
}
-
+
if (status & SERVER_JOB_CTX_INIT)
{
job_close_context(server_job_context);
@@ -1641,7 +1638,7 @@ static void usage(int argc, char **argv)
{
gossip_err("Usage: %s: [OPTIONS] <global_config_file> "
"<server_config_file>\n\n", argv[0]);
- gossip_err(" -n, \t adds hostname to server_config_file as prefix\n");
+ gossip_err(" -n, \t adds hostname to server_config_file as prefix\n");
gossip_err(" -d, --foreground\t"
"will keep server in the foreground\n");
gossip_err(" -f, --mkfs\t\twill cause server to "
@@ -1892,7 +1889,7 @@ static int server_state_machine_start(
}
/* server_state_machine_alloc_noreq()
- *
+ *
* allocates and initializes a server state machine that can later be
* started with server_state_machine_start_noreq()
*
@@ -1934,7 +1931,7 @@ int server_state_machine_alloc_noreq(
}
/* server_state_machine_start_noreq()
- *
+ *
* similar in purpose to server_state_machine_start(), except that it
* kicks off a state machine instance without first receiving a client
* side request
@@ -1988,7 +1985,7 @@ int server_state_machine_start_noreq(PIN
int server_state_machine_complete(PINT_server_op *s_op)
{
PVFS_id_gen_t tmp_id;
-
+
/* set a timestamp on the completion of the state machine */
id_gen_fast_register(&tmp_id, s_op);
PINT_event_timestamp(PVFS_EVENT_API_SM, (int32_t)s_op->req->op,
@@ -1998,11 +1995,11 @@ int server_state_machine_complete(PINT_s
if (ENCODING_IS_VALID(s_op->decoded.enc_type))
{
PVFS_free_hint(& s_op->decoded.stub_dec.req.hints);
-
+
PINT_decode_release(&(s_op->decoded),PINT_DECODE_REQ);
}
- BMI_unexpected_free(s_op->unexp_bmi_buff.addr,
+ BMI_unexpected_free(s_op->unexp_bmi_buff.addr,
s_op->unexp_bmi_buff.buffer);
s_op->unexp_bmi_buff.buffer = NULL;
@@ -2047,14 +2044,14 @@ static int parse_port_from_host_id(char*
{
return(-1);
}
-
+
return(port_num);
}
static TROVE_method_id trove_coll_to_method_callback(TROVE_coll_id coll_id)
{
struct filesystem_configuration_s * fs_conf;
-
+
fs_conf = PINT_config_find_fs_id(&server_config, coll_id);
if(!fs_conf)
{
@@ -2069,7 +2066,7 @@ void PINT_server_access_debug(PINT_serve
const char * format,
...)
{
- PVFS_handle handle;
+ PVFS_handle handle;
PVFS_fs_id fsid;
int flag;
static char pint_access_buffer[GOSSIP_BUF_SIZE];
Index: io.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/io.sm,v
diff -p -u -r1.63.2.3 -r1.63.2.4
--- io.sm 25 Sep 2006 15:28:38 -0000 1.63.2.3
+++ io.sm 27 Feb 2007 21:38:39 -0000 1.63.2.4
@@ -1,5 +1,5 @@
-/*
- * (C) 2001 Clemson University and The University of Chicago
+/*
+ * (C) 2001 Clemson University and The University of Chicago
*
* See COPYING in top-level directory.
*/
@@ -35,7 +35,7 @@ static int io_cleanup(
machine pvfs2_io_sm(
prelude,
send_positive_ack,
- send_negative_ack,
+ send_negative_ack,
start_flow,
cleanup,
release,
@@ -55,7 +55,7 @@ machine pvfs2_io_sm(
default => release;
}
- state send_negative_ack
+ state send_negative_ack
{
run io_send_ack;
default => release;
@@ -92,34 +92,36 @@ machine pvfs2_io_sm(
/*
* Function: io_send_ack()
*
- * Params: server_op *s_op,
+ * Params: server_op *s_op,
* job_status_s* js_p
*
* Pre: error code has been set in job status for us to
* report to client
*
* Post: response has been sent to client
- *
+ *
* Returns: int
*
* Synopsis: fills in a response to the I/O request, encodes it,
* and sends it to the client via BMI. Note that it may
* send either positive or negative acknowledgements.
- *
+ *
*/
static int io_send_ack(PINT_server_op *s_op, job_status_s *js_p)
{
int err = -PVFS_EIO;
job_id_t tmp_id;
struct server_configuration_s *user_opts = get_server_config_struct();
-
+
+ /*
const char * request_id;
request_id = PVFS_get_hint( s_op->req->hints,
REQUEST_ID);
if(request_id != NULL){
gossip_err("I/O request ID received: %s\n", request_id);
- }
-
+ }
+ */
+
/* this is where we report the file size to the client before
* starting the I/O transfer, or else report an error if we
* failed to get the size, or failed for permission reasons
@@ -140,7 +142,7 @@ static int io_send_ack(PINT_server_op *s
s_op->addr, s_op->encoded.buffer_list, s_op->encoded.size_list,
s_op->encoded.list_count, s_op->encoded.total_size,
s_op->tag, s_op->encoded.buffer_type, 0, s_op, 0, js_p,
- &tmp_id, server_job_context, user_opts->server_job_bmi_timeout,
+ &tmp_id, server_job_context, user_opts->server_job_bmi_timeout,
s_op->req->hints);
return err;
@@ -149,20 +151,20 @@ static int io_send_ack(PINT_server_op *s
/*
* Function: io_start_flow()
*
- * Params: server_op *s_op,
+ * Params: server_op *s_op,
* job_status_s* js_p
*
* Pre: all of the previous steps have succeeded, so that we
* are ready to actually perform the I/O
*
* Post: I/O has been carried out
- *
+ *
* Returns: int
*
* Synopsis: this is the most important part of the state machine.
- * we setup the flow descriptor and post it in order to
+ * we setup the flow descriptor and post it in order to
* carry out the data transfer
- *
+ *
*/
static int io_start_flow(PINT_server_op *s_op, job_status_s *js_p)
{
@@ -170,7 +172,7 @@ static int io_start_flow(PINT_server_op
job_id_t tmp_id;
struct server_configuration_s *user_opts = get_server_config_struct();
struct filesystem_configuration_s *fs_conf;
-
+
s_op->u.io.flow_d = PINT_flow_alloc();
if (!s_op->u.io.flow_d)
{
@@ -178,7 +180,7 @@ static int io_start_flow(PINT_server_op
return 1;
}
- /* we still have the file size stored in the response structure
+ /* we still have the file size stored in the response structure
* that we sent in the previous state, other details come from
* request
*/
@@ -209,7 +211,7 @@ static int io_start_flow(PINT_server_op
s_op->u.io.flow_d->user_ptr = NULL;
s_op->u.io.flow_d->type = s_op->req->u.io.flow_type;
- fs_conf = PINT_config_find_fs_id(user_opts,
+ fs_conf = PINT_config_find_fs_id(user_opts,
s_op->req->u.io.fs_id);
if(fs_conf)
{
@@ -218,14 +220,14 @@ static int io_start_flow(PINT_server_op
s_op->u.io.flow_d->buffers_per_flow = fs_conf->fp_buffers_per_flow;
}
- gossip_debug(GOSSIP_IO_DEBUG, "flow: fsize: %lld, "
+ gossip_debug(GOSSIP_IO_DEBUG, "flow: fsize: %lld, "
"server_nr: %d, server_ct: %d\n",
lld(s_op->u.io.flow_d->file_data.fsize),
(int)s_op->u.io.flow_d->file_data.server_nr,
(int)s_op->u.io.flow_d->file_data.server_ct);
gossip_debug(GOSSIP_IO_DEBUG, " file_req_offset: %lld, "
- "aggregate_size: %lld, handle: %llu\n",
+ "aggregate_size: %lld, handle: %llu\n",
lld(s_op->u.io.flow_d->file_req_offset),
lld(s_op->u.io.flow_d->aggregate_size),
llu(s_op->req->u.io.handle));
@@ -264,7 +266,7 @@ static int io_start_flow(PINT_server_op
/*
* Function: io_release()
*
- * Params: server_op *b,
+ * Params: server_op *b,
* job_status_s* js_p
*
* Pre: we are done with all steps necessary to service
@@ -293,7 +295,7 @@ static int io_release(PINT_server_op *s_
/*
* Function: io_cleanup()
*
- * Params: server_op *b,
+ * Params: server_op *b,
* job_status_s* js_p
*
* Pre: all jobs done, simply need to clean up
@@ -338,20 +340,20 @@ static int io_cleanup(PINT_server_op *s_
/*
* Function: io_send_completion_ack()
*
- * Params: server_op *s_op,
+ * Params: server_op *s_op,
* job_status_s* js_p
*
* Pre: flow is completed so that we can report its status
*
* Post: if this is a write, response has been sent to client
* if this is a read, do nothing
- *
+ *
* Returns: int
*
* Synopsis: fills in a response to the I/O request, encodes it,
* and sends it to the client via BMI. Note that it may
* send either positive or negative acknowledgements.
- *
+ *
*/
static int io_send_completion_ack(
PINT_server_op *s_op, job_status_s *js_p)
@@ -359,7 +361,7 @@ static int io_send_completion_ack(
int err = -PVFS_EIO;
job_id_t tmp_id;
struct server_configuration_s *user_opts = get_server_config_struct();
-
+
/* we only send this trailing ack if we are working on a write
* operation; otherwise just cut out early
*/
@@ -399,7 +401,7 @@ static int io_send_completion_ack(
s_op->addr, s_op->encoded.buffer_list, s_op->encoded.size_list,
s_op->encoded.list_count, s_op->encoded.total_size, s_op->tag,
s_op->encoded.buffer_type, 0, s_op, 0, js_p, &tmp_id,
- server_job_context, user_opts->server_job_bmi_timeout,
+ server_job_context, user_opts->server_job_bmi_timeout,
s_op->req->hints);
return err;
Index: final-response.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/final-response.sm,v
diff -p -u -r1.31.2.2 -r1.31.2.3
--- final-response.sm 25 Sep 2006 15:28:38 -0000 1.31.2.2
+++ final-response.sm 27 Feb 2007 21:38:39 -0000 1.31.2.3
@@ -1,5 +1,5 @@
-/*
- * (C) 2001 Clemson University and The University of Chicago
+/*
+ * (C) 2001 Clemson University and The University of Chicago
*
* See COPYING in top-level directory.
*/
@@ -23,7 +23,7 @@
/* PRECONDITIONS:
* - the s_op->resp struct must be filled in with the response that
* needs to be sent (not yet encoded), with one exception:
- * - js_p->error_code must indicate the status value that you wish
+ * - js_p->error_code must indicate the status value that you wish
* to have set in the response structure
* - if the operation has been scheduled, then the scheduled id must be
* stored in s_op->scheduled_id
@@ -77,7 +77,7 @@ static int final_response_release(
int ret = -1;
job_id_t tmp_id;
- gossip_debug(GOSSIP_SERVER_DEBUG,
+ gossip_debug(GOSSIP_SERVER_DEBUG,
"(%p) %s (FR sm) state: release: (error_code = %d)\n", s_op,
PINT_map_server_op_to_string(s_op->req->op),
js_p->error_code);
@@ -101,8 +101,6 @@ static int final_response_release(
ret = job_req_sched_release(
s_op->scheduled_id, s_op, 0, js_p, &tmp_id, server_job_context);
- PINT_perf_count(PINT_server_pc, PINT_PERF_REQSCHED, 1, PINT_PERF_SUB);
-
return ret;
}
@@ -116,9 +114,9 @@ static int final_response_send_resp(
int ret = -1;
job_id_t tmp_id;
struct server_configuration_s *user_opts = get_server_config_struct();
-
+
gossip_debug(
- GOSSIP_SERVER_DEBUG,
+ GOSSIP_SERVER_DEBUG,
"(%p) %s (FR sm) state: send_resp (status = %d)\n",
s_op,
PINT_map_server_op_to_string(s_op->req->op),
@@ -154,14 +152,14 @@ static int final_response_send_resp(
/* final_response_cleanup()
*
- * cleans up resources allocated while in this nested machine. Right now
+ * cleans up resources allocated while in this nested machine. Right now
* that just means releasing the encoding of the response
*/
static int final_response_cleanup(PINT_server_op *s_op, job_status_s *js_p)
{
char status_string[64] = {0};
- gossip_debug(GOSSIP_SERVER_DEBUG,
+ gossip_debug(GOSSIP_SERVER_DEBUG,
"(%p) %s (FR sm) state: cleanup\n",
s_op, PINT_map_server_op_to_string(s_op->req->op));
@@ -251,7 +249,7 @@ static void PINT_gossip_err_server_resp(
"METAFILE [ dist is %p, dist_size is %d,\n\t"
" dfile_array is %p, dfile_count is %d ]\n",
attr->u.meta.dist, attr->u.meta.dist_size,
- attr->u.meta.dfile_array,
+ attr->u.meta.dfile_array,
attr->u.meta.dfile_count);
if (attr->u.meta.dfile_array)
Index: perf-mon.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/perf-mon.sm,v
diff -p -u -r1.11 -r1.11.8.1
--- perf-mon.sm 5 Jun 2006 19:57:28 -0000 1.11
+++ perf-mon.sm 27 Feb 2007 21:38:39 -0000 1.11.8.1
@@ -1,5 +1,5 @@
-/*
- * (C) 2001 Clemson University and The University of Chicago
+/*
+ * (C) 2001 Clemson University and The University of Chicago
*
* See COPYING in top-level directory.
*/
@@ -92,7 +92,7 @@ static int perf_mon_do_work(PINT_server_
#endif
/* allocate memory to hold statistics */
- s_op->resp.u.mgmt_perf_mon.perf_array
+ s_op->resp.u.mgmt_perf_mon.perf_array
= (struct PVFS_mgmt_perf_stat*)malloc(s_op->req->u.mgmt_perf_mon.count *
sizeof(struct PVFS_mgmt_perf_stat));
if(!s_op->resp.u.mgmt_perf_mon.perf_array)
@@ -103,9 +103,9 @@ static int perf_mon_do_work(PINT_server_
/* fill in some of the response */
gettimeofday(&tv, NULL);
- s_op->resp.u.mgmt_perf_mon.cur_time_ms = tv.tv_sec*1000 +
+ s_op->resp.u.mgmt_perf_mon.cur_time_ms = tv.tv_sec*1000 +
tv.tv_usec/1000;
- s_op->resp.u.mgmt_perf_mon.suggested_next_id
+ s_op->resp.u.mgmt_perf_mon.suggested_next_id
= s_op->req->u.mgmt_perf_mon.next_id;
s_op->resp.u.mgmt_perf_mon.perf_array_count
= s_op->req->u.mgmt_perf_mon.count;
@@ -138,7 +138,7 @@ static int perf_mon_do_work(PINT_server_
{
tmp_next_id = 0;
tmp_next_id += (uint32_t)(static_start_time_array_ms[i] % MAX_NEXT_ID);
-
+
/* check three conditions:
* 1) that this interval from the perf counter is valid (start time
* not zero)
@@ -152,7 +152,7 @@ static int perf_mon_do_work(PINT_server_
{
/* found the first valid timestamp */
valid_count = i+1;
- /* compute a next id to suggest that the client use next time
+ /* compute a next id to suggest that the client use next time
* (newest time plus 1)
*/
tmp_next_id = 0;
@@ -179,22 +179,23 @@ static int perf_mon_do_work(PINT_server_
idx = valid_count - i - 1;
s_op->resp.u.mgmt_perf_mon.perf_array[idx].valid_flag = 1;
s_op->resp.u.mgmt_perf_mon.perf_array[idx].id = 0;
- s_op->resp.u.mgmt_perf_mon.perf_array[idx].id +=
+ s_op->resp.u.mgmt_perf_mon.perf_array[idx].id +=
(uint32_t)(static_start_time_array_ms[i] % 1000000000);
- s_op->resp.u.mgmt_perf_mon.perf_array[idx].start_time_ms =
+ s_op->resp.u.mgmt_perf_mon.perf_array[idx].start_time_ms =
static_start_time_array_ms[i];
- s_op->resp.u.mgmt_perf_mon.perf_array[idx].read =
+ s_op->resp.u.mgmt_perf_mon.perf_array[idx].read =
static_value_matrix[PINT_PERF_READ][i];
- s_op->resp.u.mgmt_perf_mon.perf_array[idx].write =
+ s_op->resp.u.mgmt_perf_mon.perf_array[idx].write =
static_value_matrix[PINT_PERF_WRITE][i];
- s_op->resp.u.mgmt_perf_mon.perf_array[idx].metadata_read =
+ s_op->resp.u.mgmt_perf_mon.perf_array[idx].metadata_read =
static_value_matrix[PINT_PERF_METADATA_READ][i];
- s_op->resp.u.mgmt_perf_mon.perf_array[idx].metadata_write =
+ s_op->resp.u.mgmt_perf_mon.perf_array[idx].metadata_write =
static_value_matrix[PINT_PERF_METADATA_WRITE][i];
- s_op->resp.u.mgmt_perf_mon.perf_array[idx].dspace_queue =
+ /*s_op->resp.u.mgmt_perf_mon.perf_array[idx].dspace_queue =
static_value_matrix[PINT_PERF_METADATA_DSPACE_OPS][i];
s_op->resp.u.mgmt_perf_mon.perf_array[idx].keyval_queue =
static_value_matrix[PINT_PERF_METADATA_KEYVAL_OPS][i];
+ */
}
else
{
@@ -205,7 +206,7 @@ static int perf_mon_do_work(PINT_server_
/* set final end time */
if(valid_count > 0)
{
- s_op->resp.u.mgmt_perf_mon.end_time_ms =
+ s_op->resp.u.mgmt_perf_mon.end_time_ms =
static_start_time_array_ms[0] +
static_interval_array_ms[0];
}
@@ -229,13 +230,13 @@ static int reallocate_static_arrays_if_n
int i;
/* how many keys and history intervals do we have in the perf counter? */
- ret = PINT_perf_get_info(PINT_server_pc, PINT_PERF_KEY_COUNT,
+ ret = PINT_perf_get_info(PINT_server_pc, PINT_PERF_KEY_COUNT,
&key_count);
if(ret < 0)
{
return(ret);
}
- ret = PINT_perf_get_info(PINT_server_pc, PINT_PERF_HISTORY_SIZE,
+ ret = PINT_perf_get_info(PINT_server_pc, PINT_PERF_HISTORY_SIZE,
&history_size);
if(ret < 0)
{
@@ -260,7 +261,7 @@ static int reallocate_static_arrays_if_n
{
return(-PVFS_ENOMEM);
}
- static_interval_array_ms =
+ static_interval_array_ms =
(uint64_t*)malloc(history_size*sizeof(uint64_t));
if(!static_interval_array_ms)
{
More information about the Pvfs2-cvs
mailing list