summaryrefslogtreecommitdiff
path: root/usr/src/cmd/filebench/common/procflow.c
diff options
context:
space:
mode:
authoraw148015 <Andrew.W.Wilson@sun.com>2009-04-09 16:08:05 -0700
committeraw148015 <Andrew.W.Wilson@sun.com>2009-04-09 16:08:05 -0700
commit3bf88a3dd4bc5964f3c0b9a38e88bca9973a439e (patch)
tree03bb200ebbab950b4951a00c9e0c3dfc63dc8db2 /usr/src/cmd/filebench/common/procflow.c
parented141cfca535fc26451c4bd9a2cfb6172af449c2 (diff)
downloadillumos-gate-3bf88a3dd4bc5964f3c0b9a38e88bca9973a439e.tar.gz
6584939 filebench should be smarter about how its opening files
6685196 need stricter fd/filename checking so workload writers don't get confused 6601215 Filebench needs to allow specification of a "warmup" period 6786324 need way to reuse fileset without first checking every file 6827860 FileBench is occasionally slow to exit hangs while exiting
Diffstat (limited to 'usr/src/cmd/filebench/common/procflow.c')
-rw-r--r--usr/src/cmd/filebench/common/procflow.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/usr/src/cmd/filebench/common/procflow.c b/usr/src/cmd/filebench/common/procflow.c
index 2a5207ca10..654329b5ee 100644
--- a/usr/src/cmd/filebench/common/procflow.c
+++ b/usr/src/cmd/filebench/common/procflow.c
@@ -370,10 +370,11 @@ procflow_createnwait(void *nothing)
(void) ipc_mutex_lock(&filebench_shm->shm_procflow_lock);
/* if normal shutdown in progress, just quit */
- if (filebench_shm->shm_f_abort)
+ if (filebench_shm->shm_f_abort) {
(void) ipc_mutex_unlock(
&filebench_shm->shm_procflow_lock);
pthread_exit(0);
+ }
/* if nothing running, exit */
if (filebench_shm->shm_procs_running == 0) {
@@ -440,13 +441,17 @@ procflow_init(void)
pthread_t tid;
int ret = 0;
+ if (procflow == NULL) {
+ filebench_log(LOG_ERROR, "Workload has no processes");
+ return (FILEBENCH_ERROR);
+ }
+
filebench_log(LOG_DEBUG_IMPL,
"procflow_init %s, %llu",
procflow->pf_name,
(u_longlong_t)avd_get_int(procflow->pf_instances));
#ifdef USE_PROCESS_MODEL
-
if ((pthread_create(&tid, NULL, procflow_createnwait, NULL)) != 0)
return (ret);
@@ -644,8 +649,15 @@ procflow_shutdown(void)
(void) ipc_mutex_unlock(&filebench_shm->shm_procs_running_lock);
(void) ipc_mutex_lock(&filebench_shm->shm_procflow_lock);
+ if (filebench_shm->shm_f_abort == FILEBENCH_ABORT_FINI) {
+ (void) ipc_mutex_unlock(
+ &filebench_shm->shm_procflow_lock);
+ return;
+ }
+
procflow = filebench_shm->shm_proclist;
- filebench_shm->shm_f_abort = 1;
+ if (filebench_shm->shm_f_abort == FILEBENCH_OK)
+ filebench_shm->shm_f_abort = FILEBENCH_ABORT_DONE;
while (procflow) {
if (procflow->pf_instance &&
@@ -687,8 +699,7 @@ procflow_shutdown(void)
wait_cnt--;
}
- filebench_shm->shm_f_abort = 0;
-
+ filebench_shm->shm_f_abort = FILEBENCH_ABORT_FINI;
(void) ipc_mutex_unlock(&filebench_shm->shm_procflow_lock);
/* indicate all processes are stopped, even if some are "stuck" */