From: Sean Hefty Date: Wed, 9 May 2012 22:04:10 +0000 (-0700) Subject: refresh (create temporary patch) X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=331d9830a08fce9809562f796508574054d988c8;p=~shefty%2Flibrdmacm.git refresh (create temporary patch) --- diff --git a/meta b/meta index 7953bdfe..3b3e632e 100644 --- a/meta +++ b/meta @@ -1,9 +1,10 @@ Version: 1 -Previous: d7ac6c4549ccfbd7b35b0ef878155f1363e7af9e -Head: 4b3cdaa5d7d7b873294bb6967f5c52dc7d24f246 +Previous: af20e9dcf465401e16722128a4b40ffd4c8e3e21 +Head: 2f5e1cad7ac6e2fce78085e5ae67f211d44b71a9 Applied: rs-locking: c4f4253dedaacc9fa27726bda6f1167b280576ad comp_locks: 4b3cdaa5d7d7b873294bb6967f5c52dc7d24f246 + refresh-temp: 2f5e1cad7ac6e2fce78085e5ae67f211d44b71a9 Unapplied: preload: 5dfe7abc07064485c5100e04e5412279244c2bc3 Hidden: diff --git a/patches/refresh-temp b/patches/refresh-temp new file mode 100644 index 00000000..fe297d5e --- /dev/null +++ b/patches/refresh-temp @@ -0,0 +1,74 @@ +Bottom: b2e4cd7d670a626fa22b05cff6a1dccc973e9f0d +Top: 45f68867f729e3cb78043b0ed09f9ef47ece464f +Author: Sean Hefty +Date: 2012-05-09 15:04:10 -0700 + +Refresh of comp_locks + +--- + +diff --git a/examples/rstream.c b/examples/rstream.c +index 8aa089d..8c4cfdc 100644 +--- a/examples/rstream.c ++++ b/examples/rstream.c +@@ -44,6 +44,9 @@ + + #include + #include ++#include "../src/cma.h" ++ ++static int test_mutex; + + static int test_size[] = { + 64, +@@ -276,12 +279,31 @@ static int sync_test(int rs) + static int run_test(int rs) + { + int ret, i, t; ++ fastlock_t fl; ++ pthread_mutex_t mut; + ++ fastlock_init(&fl); ++ pthread_mutex_init(&mut, NULL); + ret = sync_test(rs); + if (ret) + goto out; + ++ printf("test mutex %s\n", test_mutex == 1 ? "fastlock" : "mutex/none"); + gettimeofday(&start, NULL); ++ if (test_mutex) { ++ if (test_mutex == 1) { ++ for (i = 0; i < 2000000000; i++) { ++ fastlock_acquire(&fl); ++ fastlock_release(&fl); ++ } ++ } else { ++ for (i = 0; i < 2000000000; i++) { ++ pthread_mutex_lock(&mut); ++ pthread_mutex_unlock(&mut); ++ } ++ } ++ } ++ + for (i = 0; i < iterations; i++) { + for (t = 0; t < transfer_count; t++) { + ret = dst_addr ? send_xfer(rs, transfer_size) : +@@ -302,6 +324,8 @@ static int run_test(int rs) + ret = 0; + + out: ++ fastlock_destroy(&fl); ++ pthread_mutex_destroy(&mut); + return ret; + } + +@@ -497,6 +521,9 @@ static int set_test_opt(char *optarg) + case 'v': + verify = 1; + break; ++ case 'm': ++ test_mutex++; ++ break; + default: + return -1; + }