Recent changes (master)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit 517a1a48fd672893bc3092ce255f551ef4d8ed2a:

  Revert "debug: only do getpid() if we have to" (2013-02-27 12:32:43 +0100)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Jens Axboe (6):
      net: fix warning for systems without TCP_NODELAY
      Fix compile of RDMA engine for SunOS 5.x
      Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
      solaris: ensure that TCP_NODELAY gets picked up
      configure: add general libs for Solaris
      configure: fixup __sync_fetch_and_add()

Steven Noonan (1):
      powerpc: use mfspr for Time Base Register reads

 Makefile        |    2 +-
 arch/arch-ppc.h |    6 +++---
 configure       |   27 ++++++++++++++++++++++++---
 engines/net.c   |   10 ++++++----
 engines/rdma.c  |   46 ++++++++++++++++++++++++++++------------------
 5 files changed, 62 insertions(+), 29 deletions(-)

---

Diff of recent changes:

diff --git a/Makefile b/Makefile
index bb345ed..d55626d 100644
--- a/Makefile
+++ b/Makefile
@@ -92,7 +92,7 @@ ifeq ($(UNAME), Android)
   LDFLAGS += -rdynamic
 endif
 ifeq ($(UNAME), SunOS)
-  LIBS	 += -lpthread -ldl -laio -lrt -lnsl -lsocket
+  LIBS	 += -lpthread -ldl
   CPPFLAGS += -D__EXTENSIONS__
 endif
 ifeq ($(UNAME), FreeBSD)
diff --git a/arch/arch-ppc.h b/arch/arch-ppc.h
index 0cc0cbd..65e6b74 100644
--- a/arch/arch-ppc.h
+++ b/arch/arch-ppc.h
@@ -72,9 +72,9 @@ static inline unsigned long long get_cpu_clock(void)
 			tbl = mfspr(SPRN_ATBL);
 			tbu1 = mfspr(SPRN_ATBU);
 		} else {
-			__asm__ __volatile__("mftbu %0" : "=r"(tbu0));
-			__asm__ __volatile__("mftb %0"  : "=r"(tbl) );
-			__asm__ __volatile__("mftbu %0" : "=r"(tbu1));
+			tbu0 = mfspr(SPRN_TBRU);
+			tbl = mfspr(SPRN_TBRL);
+			tbu1 = mfspr(SPRN_TBRU);
 		}
 	} while (tbu0 != tbu1);
 
diff --git a/configure b/configure
index 8125fc3..d1f277d 100755
--- a/configure
+++ b/configure
@@ -87,7 +87,7 @@ compile_object() {
 
 compile_prog() {
   local_cflags="$1"
-  local_ldflags="$2"
+  local_ldflags="$2 $LIBS"
   echo "Compiling test case $3" >> config.log
   do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
 }
@@ -193,6 +193,7 @@ SunOS)
   if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
     cpu="x86_64"
   fi
+  LIBS="-lnsl -lsocket"
   ;;
 CYGWIN*)
   echo "Forcing known good options on Windows"
@@ -445,7 +446,7 @@ sfaa="no"
 cat > $TMPC << EOF
 static int sfaa(int *ptr)
 {
-  return __sync_fetch_and_and(ptr, 0);
+  return __sync_fetch_and_add(ptr, 0);
 }
 
 int main(int argc, char **argv)
@@ -458,7 +459,7 @@ EOF
 if compile_prog "" "" "__sync_fetch_and_add()" ; then
     sfaa="yes"
 fi
-echo "__sync_fetch_and add          $sfaa"
+echo "__sync_fetch_and_add          $sfaa"
 
 ##########################################
 # libverbs probe
@@ -909,6 +910,23 @@ if compile_prog "" "" "TCP_NODELAY"; then
 fi
 echo "TCP_NODELAY                   $tcp_nodelay"
 
+##########################################
+# Check whether we have RLIMIT_MEMLOCK
+rlimit_memlock="no"
+cat > $TMPC << EOF
+#include <sys/time.h>
+#include <sys/resource.h>
+int main(int argc, char **argv)
+{
+  struct rlimit rl;
+  return getrlimit(RLIMIT_MEMLOCK, &rl);
+}
+EOF
+if compile_prog "" "" "RLIMIT_MEMLOCK"; then
+  rlimit_memlock="yes"
+fi
+echo "RLIMIT_MEMLOCK                $rlimit_memlock"
+
 #############################################################################
 
 echo "# Automatically generated by configure - do not modify" > $config_host_mak
@@ -1017,6 +1035,9 @@ fi
 if test "$tcp_nodelay" = "yes" ; then
   output_sym "CONFIG_TCP_NODELAY"
 fi
+if test "$rlimit_memlock" = "yes" ; then
+  output_sym "CONFIG_RLIMIT_MEMLOCK"
+fi
 
 echo "LIBS+=$LIBS" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
diff --git a/engines/net.c b/engines/net.c
index 3e03bc9..624ff15 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -458,7 +458,7 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
 {
 	struct netio_data *nd = td->io_ops->data;
 	struct netio_options *o = td->eo;
-	int type, domain, optval;
+	int type, domain;
 
 	if (o->proto == FIO_TYPE_TCP) {
 		domain = AF_INET;
@@ -483,7 +483,8 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
 
 #ifdef CONFIG_TCP_NODELAY
 	if (o->nodelay && o->proto == FIO_TYPE_TCP) {
-		optval = 1;
+		int optval = 1;
+
 		if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) {
 			log_err("fio: cannot set TCP_NODELAY option on socket (%s), disable with 'nodelay=0'\n", strerror(errno));
 			return 1;
@@ -522,7 +523,7 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
 	struct netio_data *nd = td->io_ops->data;
 	struct netio_options *o = td->eo;
 	socklen_t socklen = sizeof(nd->addr);
-	int state, optval;
+	int state;
 
 	if (o->proto == FIO_TYPE_UDP) {
 		f->fd = nd->listenfd;
@@ -545,7 +546,8 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
 
 #ifdef CONFIG_TCP_NODELAY
 	if (o->nodelay && o->proto == FIO_TYPE_TCP) {
-		optval = 1;
+		int optval = 1;
+
 		if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) {
 			log_err("fio: cannot set TCP_NODELAY option on socket (%s), disable with 'nodelay=0'\n", strerror(errno));
 			return 1;
diff --git a/engines/rdma.c b/engines/rdma.c
index e1fb380..ea1af2b 100644
--- a/engines/rdma.c
+++ b/engines/rdma.c
@@ -36,7 +36,6 @@
 #include <sys/time.h>
 #include <sys/resource.h>
 
-#include <byteswap.h>
 #include <pthread.h>
 #include <inttypes.h>
 
@@ -1013,26 +1012,11 @@ static int fio_rdmaio_setup_listen(struct thread_data *td, short port)
 	return 0;
 }
 
-static int fio_rdmaio_init(struct thread_data *td)
+static int check_set_rlimits(struct thread_data *td)
 {
-	struct rdmaio_data *rd = td->io_ops->data;
-	struct flist_head *entry;
-	unsigned int max_bs;
-	unsigned int port;
-	char host[64], buf[128];
-	char *sep, *portp, *modep;
-	int ret, i = 0;
+#ifdef CONFIG_RLIMIT_MEMLOCK
 	struct rlimit rl;
 
-	if (td_rw(td)) {
-		log_err("fio: rdma connections must be read OR write\n");
-		return 1;
-	}
-	if (td_random(td)) {
-		log_err("fio: RDMA network IO can't be random\n");
-		return 1;
-	}
-
 	/* check RLIMIT_MEMLOCK */
 	if (getrlimit(RLIMIT_MEMLOCK, &rl) != 0) {
 		log_err("fio: getrlimit fail: %d(%s)\n",
@@ -1057,6 +1041,32 @@ static int fio_rdmaio_init(struct thread_data *td)
 			return 1;
 		}
 	}
+#endif
+
+	return 0;
+}
+
+static int fio_rdmaio_init(struct thread_data *td)
+{
+	struct rdmaio_data *rd = td->io_ops->data;
+	struct flist_head *entry;
+	unsigned int max_bs;
+	unsigned int port;
+	char host[64], buf[128];
+	char *sep, *portp, *modep;
+	int ret, i = 0;
+
+	if (td_rw(td)) {
+		log_err("fio: rdma connections must be read OR write\n");
+		return 1;
+	}
+	if (td_random(td)) {
+		log_err("fio: RDMA network IO can't be random\n");
+		return 1;
+	}
+
+	if (check_set_rlimits(td))
+		return 1;
 
 	strcpy(buf, td->o.filename);
 
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux