All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>,
	Mark Nelson <mark.nelson@inktank.com>,
	Mark Nelson <mark.a.nelson@gmail.com>,
	fio@vger.kernel.org
Cc: "d.gollub@telekom.de >> Daniel Gollub" <d.gollub@telekom.de>,
	"xan.peng" <xanpeng@gmail.com>,
	"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: Re: fio rbd hang for block sizes > 1M
Date: Fri, 24 Oct 2014 21:47:28 -0600	[thread overview]
Message-ID: <544B1D50.4010101@kernel.dk> (raw)
In-Reply-To: <544B0C7F.4080109@catalyst.net.nz>

[-- Attachment #1: Type: text/plain, Size: 2460 bytes --]

On 2014-10-24 20:35, Mark Kirkwood wrote:
> Patched client machine *only* - re-running fio from there works fine
> with (default - i.e no [client' section at all) cache settings:
>
> $ fio read-test.fio
> rbd_thread: (g=0): rw=read, bs=4M-4M/4M-4M/4M-4M, ioengine=rbd, iodepth=32
> fio-2.1.13-88-gb2ee7
> Starting 1 process
> rbd engine: RBD version: 0.1.8
> Jobs: 1 (f=1): [R(1)] [75.0% done] [1165MB/0KB/0KB /s] [291/0/0 iops]
> [eta 00m:0Jobs: 1 (f=1): [R(1)] [83.3% done] [447.4MB/0KB/0KB /s]
> [111/0/0 iops] [eta 00m:Jobs: 1 (f=1): [R(1)] [100.0% done]
> [268.0MB/0KB/0KB /s] [67/0/0 iops] [eta 00m:Jobs: 1 (f=1): [R(1)]
> [100.0% done] [336.1MB/0KB/0KB /s] [84/0/0 iops] [eta 00m:00s]
> rbd_thread: (groupid=0, jobs=1): err= 0: pid=5980: Sat Oct 25 15:32:16 2014
>    read : io=4096.0MB, bw=623410KB/s, iops=152, runt=  6728msec
>      slat (usec): min=7, max=230691, avg=5664.46, stdev=14434.46
>      clat (msec): min=11, max=1589, avg=193.03, stdev=246.84
>       lat (msec): min=13, max=1606, avg=198.70, stdev=248.62
>      clat percentiles (msec):
>       |  1.00th=[   17],  5.00th=[   30], 10.00th=[   43], 20.00th=[   60],
>       | 30.00th=[   78], 40.00th=[   93], 50.00th=[  109], 60.00th=[  124],
>       | 70.00th=[  147], 80.00th=[  210], 90.00th=[  498], 95.00th=[  758],
>       | 99.00th=[ 1237], 99.50th=[ 1467], 99.90th=[ 1565], 99.95th=[ 1598],
>       | 99.99th=[ 1598]
>      bw (KB  /s): min=178086, max=1193644, per=100.00%, avg=637349.58,
> stdev=397329.85
>      lat (msec) : 20=2.15%, 50=12.11%, 100=30.08%, 250=38.09%, 500=7.62%
>      lat (msec) : 750=4.79%, 1000=2.64%, 2000=2.54%
>    cpu          : usr=1.69%, sys=0.28%, ctx=6234, majf=0, minf=78
>    IO depths    : 1=0.1%, 2=0.2%, 4=0.4%, 8=1.7%, 16=58.6%, 32=39.1%,
>  >=64=0.0%
>       submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%,
>  >=64=0.0%
>       complete  : 0=0.0%, 4=94.3%, 8=5.0%, 16=0.4%, 32=0.3%, 64=0.0%,
>  >=64=0.0%
>       issued    : total=r=1024/w=0/d=0, short=r=0/w=0/d=0, drop=r=0/w=0/d=0
>       latency   : target=0, window=0, percentile=100.00%, depth=32
>
> Run status group 0 (all jobs):
>     READ: io=4096.0MB, aggrb=623410KB/s, minb=623410KB/s,
> maxb=623410KB/s, mint=6728msec, maxt=6728msec

Since you're running rbd tests... Mind giving this patch a go? I don't 
have an easy way to test it myself. It has nothing to do with this 
issue, it's just a potentially faster way to do the rbd completions.

-- 
Jens Axboe


[-- Attachment #2: rbd-complete-v2.patch --]
[-- Type: text/x-patch, Size: 4345 bytes --]

diff --git a/engines/rbd.c b/engines/rbd.c
index 6fe87b8d010c..6aa96a5ff550 100644
--- a/engines/rbd.c
+++ b/engines/rbd.c
@@ -11,6 +11,7 @@
 
 struct fio_rbd_iou {
 	struct io_u *io_u;
+	rbd_completion_t completion;
 	int io_complete;
 };
 
@@ -221,34 +222,66 @@ static struct io_u *fio_rbd_event(struct thread_data *td, int event)
 	return rbd_data->aio_events[event];
 }
 
-static int fio_rbd_getevents(struct thread_data *td, unsigned int min,
-			     unsigned int max, const struct timespec *t)
+static inline int fri_check_complete(struct rbd_data *rbd_data,
+				     struct io_u *io_u,
+				     unsigned int *events)
+{
+	struct fio_rbd_iou *fri = io_u->engine_data;
+
+	if (fri->io_complete) {
+		fri->io_complete = 0;
+		rbd_data->aio_events[*events] = io_u;
+		(*events)++;
+		return 1;
+	}
+
+	return 0;
+}
+
+static int rbd_iter_events(struct thread_data *td, unsigned int *events,
+			   unsigned int min_evts, int wait)
 {
 	struct rbd_data *rbd_data = td->io_ops->data;
-	unsigned int events = 0;
+	unsigned int this_events = 0;
 	struct io_u *io_u;
 	int i;
-	struct fio_rbd_iou *fov;
 
-	do {
-		io_u_qiter(&td->io_u_all, io_u, i) {
-			if (!(io_u->flags & IO_U_F_FLIGHT))
-				continue;
+	io_u_qiter(&td->io_u_all, io_u, i) {
+		if (!(io_u->flags & IO_U_F_FLIGHT))
+			continue;
 
-			fov = (struct fio_rbd_iou *)io_u->engine_data;
+		if (fri_check_complete(rbd_data, io_u, events))
+			this_events++;
+		else if (wait) {
+			struct fio_rbd_iou *fri = io_u->engine_data;
 
-			if (fov->io_complete) {
-				fov->io_complete = 0;
-				rbd_data->aio_events[events] = io_u;
-				events++;
-			}
+			rbd_aio_wait_for_complete(fri->completion);
 
+			if (fri_check_complete(rbd_data, io_u, events))
+				this_events++;
 		}
-		if (events < min)
-			usleep(100);
-		else
+		if (*events >= min_evts)
+			break;
+	}
+
+	return this_events;
+}
+
+static int fio_rbd_getevents(struct thread_data *td, unsigned int min,
+			     unsigned int max, const struct timespec *t)
+{
+	unsigned int this_events, events = 0;
+	int wait = 0;
+
+	do {
+		this_events = rbd_iter_events(td, &events, min, wait);
+
+		if (events >= min)
 			break;
+		if (this_events)
+			continue;
 
+		wait = 1;
 	} while (1);
 
 	return events;
@@ -258,7 +291,7 @@ static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
 {
 	int r = -1;
 	struct rbd_data *rbd_data = td->io_ops->data;
-	rbd_completion_t comp;
+	struct fio_rbd_iou *fri = io_u->engine_data;
 
 	fio_ro_check(td, io_u);
 
@@ -266,7 +299,7 @@ static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
 		r = rbd_aio_create_completion(io_u,
 					      (rbd_callback_t)
 					      _fio_rbd_finish_write_aiocb,
-					      &comp);
+					      &fri->completion);
 		if (r < 0) {
 			log_err
 			    ("rbd_aio_create_completion for DDIR_WRITE failed.\n");
@@ -274,7 +307,8 @@ static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
 		}
 
 		r = rbd_aio_write(rbd_data->image, io_u->offset,
-				  io_u->xfer_buflen, io_u->xfer_buf, comp);
+				  io_u->xfer_buflen, io_u->xfer_buf,
+				  fri->completion);
 		if (r < 0) {
 			log_err("rbd_aio_write failed.\n");
 			goto failed;
@@ -284,7 +318,7 @@ static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
 		r = rbd_aio_create_completion(io_u,
 					      (rbd_callback_t)
 					      _fio_rbd_finish_read_aiocb,
-					      &comp);
+					      &fri->completion);
 		if (r < 0) {
 			log_err
 			    ("rbd_aio_create_completion for DDIR_READ failed.\n");
@@ -292,7 +326,8 @@ static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
 		}
 
 		r = rbd_aio_read(rbd_data->image, io_u->offset,
-				 io_u->xfer_buflen, io_u->xfer_buf, comp);
+				 io_u->xfer_buflen, io_u->xfer_buf,
+				 fri->completion);
 
 		if (r < 0) {
 			log_err("rbd_aio_read failed.\n");
@@ -303,14 +338,14 @@ static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
 		r = rbd_aio_create_completion(io_u,
 					      (rbd_callback_t)
 					      _fio_rbd_finish_sync_aiocb,
-					      &comp);
+					      &fri->completion);
 		if (r < 0) {
 			log_err
 			    ("rbd_aio_create_completion for DDIR_SYNC failed.\n");
 			goto failed;
 		}
 
-		r = rbd_aio_flush(rbd_data->image, comp);
+		r = rbd_aio_flush(rbd_data->image, fri->completion);
 		if (r < 0) {
 			log_err("rbd_flush failed.\n");
 			goto failed;

  reply	other threads:[~2014-10-25  3:47 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24  2:38 fio rbd hang for block sizes > 1M Mark Kirkwood
2014-10-24  5:35 ` Jens Axboe
2014-10-24  6:17   ` Mark Kirkwood
2014-10-24 13:19     ` Mark Nelson
     [not found]       ` <544A51C7.40803-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-24 14:09         ` Mark Nelson
2014-10-24 14:09           ` Mark Nelson
     [not found]           ` <544A5DA6.2010709-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-24 14:30             ` Jens Axboe
2014-10-24 14:30               ` Jens Axboe
2014-10-24 22:45             ` Mark Kirkwood
2014-10-24 22:45               ` Mark Kirkwood
     [not found]               ` <544AD67D.4030603-6STWZtX7tXAqAMOr+u8IRA@public.gmane.org>
2014-10-25  0:12                 ` Mark Nelson
2014-10-25  0:12                   ` Mark Nelson
     [not found]                   ` <544AEAE7.6080603-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-10-25  0:37                     ` Mark Kirkwood
2014-10-25  0:37                       ` Mark Kirkwood
     [not found]                       ` <544AF0D2.1050405-6STWZtX7tXAqAMOr+u8IRA@public.gmane.org>
2014-10-25  2:35                         ` Mark Kirkwood
2014-10-25  2:35                           ` Mark Kirkwood
2014-10-25  3:47                           ` Jens Axboe [this message]
2014-10-25  4:50                             ` fio rbd completions (Was: fio rbd hang for block sizes > 1M) Mark Kirkwood
2014-10-25 19:20                               ` Jens Axboe
     [not found]                                 ` <544BF808.2090800-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2014-10-25 22:25                                   ` Mark Kirkwood
2014-10-25 22:25                                     ` Mark Kirkwood
2014-10-27  9:27                                     ` Ketor D
     [not found]                                       ` <CAM9_UU_S7qhenZW34Lw3r=RHoVa1__610RRsFScgt0adi1dpFw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-27 10:25                                         ` Ketor D
2014-10-27 10:25                                           ` Ketor D
2014-10-27 14:19                                           ` Jens Axboe
2014-10-27 14:15                                       ` Jens Axboe
     [not found]                                     ` <544C2371.1020403-6STWZtX7tXAqAMOr+u8IRA@public.gmane.org>
2014-10-27 14:19                                       ` Jens Axboe
2014-10-27 14:19                                         ` Jens Axboe
     [not found]                                         ` <544E547C.30009-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2014-10-27 15:12                                           ` Ketor D
2014-10-27 15:12                                             ` Ketor D
2014-10-27 15:22                                             ` Jens Axboe
2014-10-27 15:25                                               ` Jens Axboe
2014-10-27 15:29                                                 ` Ketor D
     [not found]                                                   ` <CAM9_UU-35i9uRu9EDQSM-b7CjmxrKYV2Gz8ocrykOYk+2q++hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-27 15:36                                                     ` Jens Axboe
2014-10-27 15:36                                                       ` Jens Axboe
2014-10-27 15:45                                                       ` Ketor D
2014-10-27 15:53                                                         ` Jens Axboe
2014-10-27 16:20                                                           ` Ketor D
     [not found]                                                           ` <CAM9_UU8x2uZZUWaPPoy+LH mUhC_3sqKZ9GPsEqDwKUkprg4kdQ@mail.gmail.com>
     [not found]                                                             ` <CAM9_UU8x2uZZUWaPPoy+LHmUhC_3sqKZ9GPsEqDwKUkprg4kdQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-27 16:55                                                               ` Jens Axboe
2014-10-27 16:55                                                                 ` Jens Axboe
2014-10-27 21:59                                                               ` Mark Kirkwood
2014-10-27 21:59                                                                 ` Mark Kirkwood
2014-10-27 22:32                                                                 ` Jens Axboe
2014-10-27 22:32                                                                   ` Jens Axboe
     [not found]                                                                   ` <544EC7F1.6010900-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2014-10-27 23:21                                                                     ` Mark Kirkwood
2014-10-27 23:21                                                                       ` Mark Kirkwood
     [not found]                                                                       ` <544ED37D.6060800-6STWZtX7tXAqAMOr+u8IRA@public.gmane.org>
2014-10-28  3:23                                                                         ` Ketor D
2014-10-28  3:23                                                                           ` Ketor D
     [not found]                                                                           ` <CAM9_UU8MHdj+mjAWBziETxPDnwTt0JBuHrQp2Fu9YtF=msae3w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-28  4:01                                                                             ` Mark Kirkwood
2014-10-28  4:01                                                                               ` Mark Kirkwood
2014-10-28  4:05                                                                           ` Jens Axboe
2014-10-28  4:49                                                                             ` Ketor D
     [not found]                                                                               ` <CAM9_UU9G5vQ68UxMakte-Wb5B9_KBo24ov7=hNHpYqEtko2nQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-28 15:14                                                                                 ` Jens Axboe
2014-10-28 15:14                                                                                   ` Jens Axboe
2014-10-28 15:49                                                                                   ` Ketor D
     [not found]                                                                                     ` <CAM9_UU_o8kS1wJnDKTvd8+qkm9=93yfW3THr_8ni8C+5=TH6tg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-28 15:53                                                                                       ` Jens Axboe
2014-10-28 15:53                                                                                         ` Jens Axboe
2014-10-28 17:09                                                                                       ` Jens Axboe
2014-10-28 17:09                                                                                         ` Jens Axboe
2014-10-28 18:43                                                                                         ` Ketor D
2014-10-29  7:15                                                                                           ` Ketor D
     [not found]                                                                                             ` <CAM9_UU8=MtUnQiembBfr8YQiDOD7TNey=mp8_H6gySenRVHy6A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-29 14:31                                                                                               ` Jens Axboe
2014-10-29 14:31                                                                                                 ` Jens Axboe
     [not found]                                                                                                 ` <5450FA47.2030203-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2014-10-30  2:50                                                                                                   ` Ketor D
2014-10-30  2:50                                                                                                     ` Ketor D
2014-10-30  2:55                                                                                                     ` Jens Axboe
2014-10-30  2:55                                                                                                       ` Jens Axboe
2014-10-30  5:29                                                                                                       ` Ketor D
2014-10-30  7:44                                                                                                 ` Mark Kirkwood
2014-10-30  7:44                                                                                                   ` Mark Kirkwood
2014-10-30  8:04                                                                                                   ` Ketor D
2014-10-31  8:54                                                                                                     ` Mark Kirkwood
2014-10-31  8:54                                                                                                       ` Mark Kirkwood
2014-10-24 22:30       ` fio rbd hang for block sizes > 1M Mark Kirkwood
2014-10-24 22:38         ` Mark Nelson
2014-10-24 14:11   ` Danny Al-Gaaf
2014-10-24 14:31     ` Jens Axboe

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=544B1D50.4010101@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=ceph-devel@vger.kernel.org \
    --cc=d.gollub@telekom.de \
    --cc=fio@vger.kernel.org \
    --cc=mark.a.nelson@gmail.com \
    --cc=mark.kirkwood@catalyst.net.nz \
    --cc=mark.nelson@inktank.com \
    --cc=xanpeng@gmail.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 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.