From: Jens Axboe <axboe@kernel.dk>
To: Jeff Furlong <jeff.furlong@wdc.com>,
"fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: fio server/client disconnect bug
Date: Wed, 21 Mar 2018 13:10:09 -0600 [thread overview]
Message-ID: <920b95c9-070a-b3ba-1da3-8b28cf9a82d9@kernel.dk> (raw)
In-Reply-To: <027c68c5-549d-8b4e-f606-84f8b321eb04@kernel.dk>
On 3/21/18 1:03 PM, Jens Axboe wrote:
> Shoot, I think I see what it is. Some commands we punt to out-of-line
> sending, others we do inline. STOP/QUIT are inline, whereas the ts/gs/du
> are not. So we could potentially have a situation where we queue up the
> ts/gs/du, but then process the STOP/QUIT first. If we do that, then we
> don't get any output...
>
> Let me think about this for a bit, and see what I can come up with.
Can you try with this? Can be improved to have the thread signal us,
but it should be a rare occurrence and a 1ms stall from this context
isn't a concern.
diff --git a/server.c b/server.c
index 65d4484edae5..52bcf7bf44c6 100644
--- a/server.c
+++ b/server.c
@@ -551,9 +551,15 @@ static void fio_net_queue_entry(struct sk_entry *entry)
{
struct sk_out *sk_out = pthread_getspecific(sk_out_key);
- if (entry->flags & SK_F_INLINE)
+ if (entry->flags & SK_F_INLINE) {
+ /*
+ * Honor ordering - if the out-of-line queue isn't empty,
+ * wait for it to drain before proceeding.
+ */
+ while (!flist_empty(&sk_out->list))
+ usleep(1000);
handle_sk_entry(sk_out, entry);
- else {
+ } else {
sk_lock(sk_out);
flist_add_tail(&entry->list, &sk_out->list);
sk_unlock(sk_out);
--
Jens Axboe
next prev parent reply other threads:[~2018-03-21 19:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-16 0:32 fio server/client disconnect bug Jeff Furlong
2018-03-21 0:16 ` Jeff Furlong
2018-03-21 15:19 ` Jens Axboe
2018-03-21 16:19 ` Jens Axboe
2018-03-21 16:27 ` Jens Axboe
2018-03-21 16:35 ` Jeff Furlong
2018-03-21 16:38 ` Jens Axboe
2018-03-21 16:58 ` Jeff Furlong
2018-03-21 17:12 ` Jens Axboe
2018-03-21 18:16 ` Jeff Furlong
2018-03-21 18:38 ` Jens Axboe
2018-03-21 19:03 ` Jens Axboe
2018-03-21 19:10 ` Jens Axboe [this message]
2018-03-21 19:44 ` Jens Axboe
2018-03-21 19:45 ` Jeff Furlong
2018-03-21 19:49 ` Jens Axboe
2018-03-21 21:45 ` Jeff Furlong
2018-03-21 21:47 ` Jens Axboe
2018-03-21 21:51 ` Jens Axboe
2018-03-21 21:58 ` Jeff Furlong
2018-03-21 19:23 ` Jeff Furlong
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=920b95c9-070a-b3ba-1da3-8b28cf9a82d9@kernel.dk \
--to=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=jeff.furlong@wdc.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox