Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Feb 19, 2014 Kbuild

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 81fa6e06408879509e005cbb192205b9125f7614:

Fix early termination of cpu id string (2014-02-14 08:48:22 -0700)

are available in the git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to dc632d12d74bab6a439aaf8c317d250d3a8def5c:

add example job file for the RBD engine (2014-02-18 11:22:16 -0800)

----------------------------------------------------------------
Daniel Gollub (1):
librbd ioengine support

Danny Al-Gaaf (2):
fio.1: add rbd options to man page
add example job file for the RBD engine

 Makefile         |    3 +
 configure        |   30 ++++
 engines/rbd.c    |  449 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 examples/rbd.fio |   23 +++
 fio.1            |   14 ++
 options.c        |    5 +
 options.h        |    2 +
 7 files changed, 526 insertions(+)
 create mode 100644 engines/rbd.c
 create mode 100644 examples/rbd.fio

---

Diff of recent changes:

Makefile +3 -0
index 3f654f0..1113c2f 100644
@@ -76,6 +76,9 @@ endif
 ifdef CONFIG_WINDOWSAIO
   SOURCE += engines/windowsaio.c
 endif
+ifdef CONFIG_RBD
+  SOURCE += engines/rbd.c
+endif
 ifndef CONFIG_STRSEP
   SOURCE += lib/strsep.c
 endif
configure +30 -0
index 89405cd..4b00679 100755
@@ -1119,6 +1119,33 @@ if compile_prog "" "" "ipv6"; then
 fi
 echo "IPv6 helpers                  $ipv6"
 
+##########################################
+# check for rbd
+rbd="no"
+cat > $TMPC << EOF
+#include <rbd/librbd.h>
+
+int main(int argc, char **argv)
+{
+
+  rados_t cluster;
+  rados_ioctx_t io_ctx;
+  const char pool[] = "rbd";
+
+  int major, minor, extra;
+  rbd_version(&major, &minor, &extra);
+
+  rados_ioctx_create(cluster, pool, &io_ctx);
+  return 0;
+}
+EOF
+if compile_prog "" "-lrbd -lrados" "rbd"; then
+  LIBS="-lrbd -lrados $LIBS"
+  rbd="yes"
+fi
+echo "Rados Block Device engine     $rbd"
+
+
 #############################################################################
 
 if test "$wordsize" = "64" ; then
@@ -1240,6 +1267,9 @@ fi
 if test "$ipv6" = "yes" ; then
   output_sym "CONFIG_IPV6"
 fi
+if test "$rbd" = "yes" ; then
+  output_sym "CONFIG_RBD"
+fi
 
 echo "LIBS+=$LIBS" >> $config_host_mak
 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
engines/rbd.c new file +449 -0

449 lines not on this page · raw message

examples/rbd.fio new file +23 -0
new file mode 100644
index 0000000..fcb494a
@@ -0,0 +1,23 @@
+######################################################################
+# Example test for the RBD engine.
+# 
+# Runs a 4k random write test agains a RBD via librbd  
+#
+# NOTE: Make sure you have either a RBD named 'fio_test' or change 
+#       the rbdname parameter.
+######################################################################
+[global]
+#logging
+#write_iops_log=write_iops_log
+#write_bw_log=write_bw_log
+#write_lat_log=write_lat_log
+ioengine=rbd
+clientname=admin
+pool=rbd
+rbdname=fio_test
+invalidate=0	# mandatory
+rw=randwrite
+bs=4k
+
+[rbd_iodepth32]
+iodepth=32
fio.1 +14 -0
index ec10377..1df1cd1 100644
@@ -557,6 +557,11 @@ transfer as fio ioengine
 .B e4defrag
 IO engine that does regular EXT4_IOC_MOVE_EXT ioctls to simulate defragment activity
 request to DDIR_WRITE event
+.TP
+.B rbd
+IO engine supporting direct access to Ceph Rados Block Devices (RBD) via librbd 
+without the need to use the kernel rbd driver. This ioengine defines engine specific 
+options.
 .RE
 .P
 .RE
@@ -1394,6 +1399,15 @@ Preallocate donor's file on init
 .BI 1:
 allocate space immediately inside defragment event, and free right after event
 .RE
+.TP
+.BI (rbd)rbdname \fR=\fPstr
+Specifies the name of the RBD.
+.TP
+.BI (rbd)pool \fR=\fPstr
+Specifies the name of the Ceph pool containing the RBD.
+.TP
+.BI (rbd)clientname \fR=\fPstr
+Specifies the username (without the 'client.' prefix) used to access the Ceph cluster.
 .SH OUTPUT
 While running, \fBfio\fR will display the status of the created jobs.  For
 example:
options.c +5 -0
index 4dcefba..ea51664 100644
@@ -1388,6 +1388,11 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 			    .help = "Windows native asynchronous IO"
 			  },
 #endif
+#ifdef CONFIG_RBD
+			  { .ival = "rbd",
+			    .help = "Rados Block Device asynchronous IO"
+			  },
+#endif
 			  { .ival = "mmap",
 			    .help = "Memory mapped IO"
 			  },
options.h +2 -0
index fc36368..3dc48a9 100644
@@ -95,6 +95,7 @@ enum opt_category_group {
 	__FIO_OPT_G_LIBAIO,
 	__FIO_OPT_G_ACT,
 	__FIO_OPT_G_LATPROF,
+        __FIO_OPT_G_RBD,
 	__FIO_OPT_G_NR,
 
 	FIO_OPT_G_RATE		= (1U << __FIO_OPT_G_RATE),
@@ -124,6 +125,7 @@ enum opt_category_group {
 	FIO_OPT_G_LIBAIO	= (1U << __FIO_OPT_G_LIBAIO),
 	FIO_OPT_G_ACT		= (1U << __FIO_OPT_G_ACT),
 	FIO_OPT_G_LATPROF	= (1U << __FIO_OPT_G_LATPROF),
+	FIO_OPT_G_RBD		= (1U << __FIO_OPT_G_RBD),
 	FIO_OPT_G_INVALID	= (1U << __FIO_OPT_G_NR),
 };