All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Scott Emery <emery@sgi.com>
Cc: fio@vger.kernel.org
Subject: Re: All clients impatient
Date: Wed, 14 Nov 2012 10:54:05 -0700	[thread overview]
Message-ID: <50A3DABD.3020807@kernel.dk> (raw)
In-Reply-To: <50A3D823.4050707@kernel.dk>

On 2012-11-14 10:42, Jens Axboe wrote:
>> 	For a while it was totting things up after four clients,
>> which kind of made sense... now it's stuck on three.  Back when
>> it made more sense I thought that maybe handle_ts only dealt with
>> the information from a single thread for each client rather than
>> the aggregate of multiple thread jobs.  That part seems to hold
>> true even when it doesn't have the info for all the clients.
>>
>> 	Is this reporting the aggregate as expected?
>> 	Is there a parameter change that I need to make to get
>> the output I expect?
> 
> As the job file is written, it will not aggregate results from a single
> "instance" of the server. You would want group_reporting=1 to do that.
> However, that will still give you one set of outputs per connection, not
> one for all of them. Right now fio does not support collecting outputs
> from all connections, a higher level group reporting if you will.

Actually, I misremembered that and didn't check before replying. It
_will_ sum all clients, if it has more than one connection. But there's
a bug where we race on client exit and dec the expected client count.
Does it work better with the below patch?


diff --git a/client.c b/client.c
index bf09d7e..f82bc30 100644
--- a/client.c
+++ b/client.c
@@ -50,6 +50,7 @@ struct fio_client {
 	int error;
 	int ipv6;
 	int sent_job;
+	int did_stat;
 
 	struct flist_head eta_list;
 	struct client_eta *eta_in_flight;
@@ -83,6 +84,7 @@ static struct thread_stat client_ts;
 static struct group_run_stats client_gs;
 static int sum_stat_clients;
 static int sum_stat_nr;
+static int do_output_all_clients;
 
 #define FIO_CLIENT_HASH_BITS	7
 #define FIO_CLIENT_HASH_SZ	(1 << FIO_CLIENT_HASH_BITS)
@@ -159,9 +161,11 @@ static void remove_client(struct fio_client *client)
 	if (client->ini_file)
 		free(client->ini_file);
 
+	if (!client->did_stat)
+		sum_stat_clients--;
+
 	free(client);
 	nr_clients--;
-	sum_stat_clients--;
 }
 
 static void put_client(struct fio_client *client)
@@ -664,7 +668,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src)
 	dst->groupid	= le32_to_cpu(src->groupid);
 }
 
-static void handle_ts(struct fio_net_cmd *cmd)
+static void handle_ts(struct fio_client *client, struct fio_net_cmd *cmd)
 {
 	struct cmd_ts_pdu *p = (struct cmd_ts_pdu *) cmd->payload;
 
@@ -672,8 +676,9 @@ static void handle_ts(struct fio_net_cmd *cmd)
 	convert_gs(&p->rs, &p->rs);
 
 	show_thread_status(&p->ts, &p->rs);
+	client->did_stat = 1;
 
-	if (sum_stat_clients == 1)
+	if (!do_output_all_clients)
 		return;
 
 	sum_thread_stats(&client_ts, &p->ts, sum_stat_nr);
@@ -921,7 +926,7 @@ static int handle_client(struct fio_client *client)
 		free(cmd);
 		break;
 	case FIO_NET_CMD_TS:
-		handle_ts(cmd);
+		handle_ts(client, cmd);
 		free(cmd);
 		break;
 	case FIO_NET_CMD_GS:
@@ -1054,6 +1059,9 @@ int fio_handle_clients(void)
 	pfds = malloc(nr_clients * sizeof(struct pollfd));
 
 	sum_stat_clients = nr_clients;
+	if (sum_stat_clients > 1)
+		do_output_all_clients = 1;
+
 	init_thread_stat(&client_ts);
 	init_group_run_stat(&client_gs);
 

-- 
Jens Axboe


  reply	other threads:[~2012-11-14 17:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-13 23:23 All clients impatient Scott Emery
2012-11-14 17:42 ` Jens Axboe
2012-11-14 17:54   ` Jens Axboe [this message]
2012-11-14 18:10     ` Jens Axboe
2012-11-14 19:09       ` emery
2012-11-14 19:29         ` emery
2012-11-14 19:58           ` Jens Axboe
2012-11-14 20:57             ` Jens Axboe
2012-11-14 21:30               ` emery
2012-11-14 21:31                 ` Jens Axboe
2012-11-14 21:26             ` emery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50A3DABD.3020807@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=emery@sgi.com \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.